mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
To simplify code, remove old business logic
This commit is contained in:
parent
f826225132
commit
df7caf6747
@ -34,9 +34,7 @@ final class GildedRose
|
|||||||
|
|
||||||
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') {
|
$item->quality = $item->quality - 1;
|
||||||
$item->quality = $item->quality - 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($item->quality < 50) {
|
if ($item->quality < 50) {
|
||||||
@ -56,17 +54,13 @@ final class GildedRose
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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') {
|
$item->quality = $item->quality - 1;
|
||||||
$item->quality = $item->quality - 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$item->quality = $item->quality - $item->quality;
|
$item->quality = $item->quality - $item->quality;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user