diff --git a/php7/src/GildedRose.php b/php7/src/GildedRose.php index 134f1488..016e6fe9 100644 --- a/php7/src/GildedRose.php +++ b/php7/src/GildedRose.php @@ -49,32 +49,28 @@ final class GildedRose public function updateQuality() { foreach ($this->_items as $item) { - if ($item->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') { + if ($item->name != 'Aged Brie' && $item->name != 'Backstage passes to a TAFKAL80ETC concert') { if ($item->quality > 0) { if ($item->name != 'Sulfuras, Hand of Ragnaros') { - $item->quality = $item->quality - 1; + $item->quality--; } } } else { if ($item->quality < 50) { - $item->quality = $item->quality + 1; + $item->quality = $item->quality++; if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') { if ($item->sell_in < 11) { - if ($item->quality < 50) { - $item->quality = $item->quality + 2; - } + $item->quality += 2; } if ($item->sell_in < 6) { - if ($item->quality < 50) { - $item->quality = $item->quality + 3; - } + $item->quality += 3; } } } } if ($item->name != 'Sulfuras, Hand of Ragnaros') { - $item->sell_in = $item->sell_in - 1; + $item->sell_in--; } if ($item->sell_in < 0) { @@ -82,15 +78,15 @@ final class GildedRose if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') { if ($item->quality > 0) { if ($item->name != 'Sulfuras, Hand of Ragnaros') { - $item->quality = $item->quality - 2; + $item->quality -= 2; } } } else { - $item->quality = $item->quality - $item->quality; + $item->quality = 0; } } else { if ($item->quality < 50) { - $item->quality = $item->quality + 1; + $item->quality++; } } }