mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-13 13:42:00 +00:00
chore: re-arrange cases
This commit is contained in:
parent
4919bd0d67
commit
fa45d56689
@ -21,12 +21,10 @@ final class GildedRose
|
||||
if ($item->name === 'Sulfuras, Hand of Ragnaros')
|
||||
continue;
|
||||
|
||||
$item->sellIn--;
|
||||
|
||||
if ($item->name === 'Aged Brie') {
|
||||
$item->quality = min(50, ++$item->quality);
|
||||
} else if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->sellIn < 0) {
|
||||
if ($item->sellIn <= 1) {
|
||||
$item->quality = 0;
|
||||
} else if ($item->sellIn <= 5) {
|
||||
$item->quality = min(50, $item->quality + 3);
|
||||
@ -36,6 +34,8 @@ final class GildedRose
|
||||
} else {
|
||||
$item->quality = max(0, $item->quality - 2);
|
||||
}
|
||||
|
||||
$item->sellIn--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user