mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-20 08:51:08 +00:00
chore: update Aged Brie quality
This commit is contained in:
parent
80a2e70216
commit
5a11204272
@ -18,14 +18,14 @@ final class GildedRose
|
|||||||
public function updateQuality(): void
|
public function updateQuality(): void
|
||||||
{
|
{
|
||||||
foreach ($this->items as $item) {
|
foreach ($this->items as $item) {
|
||||||
|
|
||||||
if ($item->name === 'Sulfuras, Hand of Ragnaros') {
|
if ($item->name === 'Sulfuras, Hand of Ragnaros') {
|
||||||
continue;
|
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') {
|
||||||
$item->quality = max(0, --$item->quality);
|
$item->quality = max(0, --$item->quality);
|
||||||
|
} else if ($item->name === 'Aged Brie') {
|
||||||
|
$item->quality = min(50, ++$item->quality);
|
||||||
} else {
|
} else {
|
||||||
if ($item->quality < 50) {
|
if ($item->quality < 50) {
|
||||||
$item->quality = $item->quality + 1;
|
$item->quality = $item->quality + 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user