mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-14 14:11:20 +00:00
chore: aged brie can't be more than 50
This commit is contained in:
parent
886314f844
commit
e6bf563126
@ -11,7 +11,8 @@ final class GildedRose
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private array $items
|
private array $items
|
||||||
) {
|
)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateQuality(): void
|
public function updateQuality(): void
|
||||||
@ -46,7 +47,7 @@ final class GildedRose
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($item->sellIn < 0) {
|
if ($item->sellIn < 0) {
|
||||||
if ($item->name != 'Aged Brie') {
|
|
||||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||||
if ($item->quality > 0) {
|
if ($item->quality > 0) {
|
||||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||||
@ -56,11 +57,11 @@ final class GildedRose
|
|||||||
} else {
|
} else {
|
||||||
$item->quality = $item->quality - $item->quality;
|
$item->quality = $item->quality - $item->quality;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ($item->quality < 50) {
|
if ($item->name === 'Aged Brie') {
|
||||||
$item->quality = $item->quality + 1;
|
$item->quality = max(50, $item->quality++);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user