mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-17 15:31:27 +00:00
Use strict type check
This commit is contained in:
parent
c66437d1a4
commit
d7a4efeef7
@ -24,16 +24,16 @@ final class GildedRose
|
|||||||
public function updateQuality(): void
|
public function updateQuality(): void
|
||||||
{
|
{
|
||||||
foreach ($this->items as $item) {
|
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->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 {
|
} else {
|
||||||
if ($item->quality < 50) {
|
if ($item->quality < 50) {
|
||||||
$item->quality = $item->quality + 1;
|
$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->sellIn < 11) {
|
||||||
if ($item->quality < 50) {
|
if ($item->quality < 50) {
|
||||||
$item->quality = $item->quality + 1;
|
$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;
|
$item->sellIn = $item->sellIn - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item->sellIn < 0) {
|
if ($item->sellIn < 0) {
|
||||||
if ($item->name != 'Aged Brie') {
|
if ($item->name !== 'Aged Brie') {
|
||||||
if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {
|
if ($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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user