mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-13 13:42:00 +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(
|
||||
private array $items
|
||||
) {
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function updateQuality(): void
|
||||
@ -46,21 +47,21 @@ final class GildedRose
|
||||
}
|
||||
|
||||
if ($item->sellIn < 0) {
|
||||
if ($item->name != 'Aged Brie') {
|
||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->quality = $item->quality - 1;
|
||||
}
|
||||
|
||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
if ($item->name != 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->quality = $item->quality - 1;
|
||||
}
|
||||
} else {
|
||||
$item->quality = $item->quality - $item->quality;
|
||||
}
|
||||
} else {
|
||||
if ($item->quality < 50) {
|
||||
$item->quality = $item->quality + 1;
|
||||
}
|
||||
$item->quality = $item->quality - $item->quality;
|
||||
}
|
||||
|
||||
if ($item->name === 'Aged Brie') {
|
||||
$item->quality = max(50, $item->quality++);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user