Relocate special Sulfuras exception to be more buried.

This commit is contained in:
Kevin Boyd 2019-05-22 16:46:01 -07:00
parent 501cb7e041
commit 216f754aee

View File

@ -12,16 +12,12 @@ final class GildedRose {
public function updateQuality() { public function updateQuality() {
foreach ($this->items as $item) { 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->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') {
if ($item->quality > 0) { if ($item->quality > 0) {
if ($item->name != 'Sulfuras, Hand of Ragnaros') { if ($item->name != 'Sulfuras, Hand of Ragnaros') {
$item->quality = $item->quality - 1; $item->quality = $item->quality - 1;
} else {
$item->quality = 80;
} }
} }
} else { } else {