mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-14 06:01:39 +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')
|
if ($item->name === 'Sulfuras, Hand of Ragnaros')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$item->sellIn--;
|
|
||||||
|
|
||||||
if ($item->name === 'Aged Brie') {
|
if ($item->name === 'Aged Brie') {
|
||||||
$item->quality = min(50, ++$item->quality);
|
$item->quality = min(50, ++$item->quality);
|
||||||
} else if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') {
|
} else if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') {
|
||||||
if ($item->sellIn < 0) {
|
if ($item->sellIn <= 1) {
|
||||||
$item->quality = 0;
|
$item->quality = 0;
|
||||||
} else if ($item->sellIn <= 5) {
|
} else if ($item->sellIn <= 5) {
|
||||||
$item->quality = min(50, $item->quality + 3);
|
$item->quality = min(50, $item->quality + 3);
|
||||||
@ -36,6 +34,8 @@ final class GildedRose
|
|||||||
} else {
|
} else {
|
||||||
$item->quality = max(0, $item->quality - 2);
|
$item->quality = max(0, $item->quality - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$item->sellIn--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user