mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 15:01:28 +00:00
Syntax operators and Conjured brand.
This commit is contained in:
parent
9fc06142b3
commit
efb4e9b9bf
@ -52,9 +52,16 @@ final class GildedRose
|
||||
if ($item->name === 'Sulfuras, Hand of Ragnaros') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$item->sell_in--;
|
||||
|
||||
if ($item->name !== 'Aged Brie' && $item->name !== 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
if ($item->quality > 0) {
|
||||
$item->quality--;
|
||||
if (strstr($item->name, 'Conjured') === 0) {
|
||||
$item->quality -= 2;
|
||||
} else {
|
||||
$item->quality--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($item->quality < 50) {
|
||||
@ -70,16 +77,14 @@ final class GildedRose
|
||||
}
|
||||
}
|
||||
|
||||
$item->sell_in--;
|
||||
|
||||
if ($item->sell_in < 0) {
|
||||
if ($item->name !== 'Aged Brie') {
|
||||
if ($item->name !== 'BackstageString passes to a TAFKAL80ETC concert') {
|
||||
if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
$item->quality = 0;
|
||||
} else {
|
||||
if ($item->quality > 0) {
|
||||
$item->quality -= 2;
|
||||
}
|
||||
} else {
|
||||
$item->quality = 0;
|
||||
}
|
||||
} else {
|
||||
if ($item->quality < 50) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user