mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Relocate special Sulfuras exception to be more buried.
This commit is contained in:
parent
501cb7e041
commit
216f754aee
@ -12,16 +12,12 @@ final class GildedRose {
|
||||
|
||||
public function updateQuality() {
|
||||
foreach ($this->items as $item) {
|
||||
if ($item->name === 'Sulfuras, Hand of Ragnaros') {
|
||||
$item->quality = 80;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($item->name != 'Aged Brie' and $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 = 80;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user