mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-17 19:35:06 +00:00
Relocate special Sulfuras exception to be more buried.
This commit is contained in:
1 parent
501cb7e041
commit
216f754aee
1 file changed
+2
-6
@@ -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 {
|
||||||
|
|||||||
Reference in new issue
Block a user