From d7a4efeef7ff343daf46377420f0741397df5071 Mon Sep 17 00:00:00 2001 From: kitfbgh Date: Sat, 2 Apr 2022 11:22:59 +0800 Subject: [PATCH] Use strict type check --- php/src/GildedRose.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/php/src/GildedRose.php b/php/src/GildedRose.php index 54c921cb..735c0a0e 100644 --- a/php/src/GildedRose.php +++ b/php/src/GildedRose.php @@ -24,16 +24,16 @@ final class GildedRose public function updateQuality(): void { foreach ($this->items as $item) { - 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->name != 'Sulfuras, Hand of Ragnaros') { + if ($item->name !== 'Sulfuras, Hand of Ragnaros') { $item->quality = $item->quality - 1; } } } else { if ($item->quality < 50) { $item->quality = $item->quality + 1; - if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') { + if ($item->name === 'Backstage passes to a TAFKAL80ETC concert') { if ($item->sellIn < 11) { if ($item->quality < 50) { $item->quality = $item->quality + 1; @@ -48,15 +48,15 @@ final class GildedRose } } - if ($item->name != 'Sulfuras, Hand of Ragnaros') { + if ($item->name !== 'Sulfuras, Hand of Ragnaros') { $item->sellIn = $item->sellIn - 1; } if ($item->sellIn < 0) { - if ($item->name != 'Aged Brie') { - if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') { + if ($item->name !== 'Aged Brie') { + if ($item->name !== 'Backstage passes to a TAFKAL80ETC concert') { if ($item->quality > 0) { - if ($item->name != 'Sulfuras, Hand of Ragnaros') { + if ($item->name !== 'Sulfuras, Hand of Ragnaros') { $item->quality = $item->quality - 1; } }