mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 15:01:28 +00:00
26 lines
467 B
PHP
26 lines
467 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace GildedRose;
|
|
|
|
final class GildedRose
|
|
{
|
|
/**
|
|
* @param Item[] $items
|
|
*/
|
|
public function __construct(
|
|
private array $items
|
|
) {
|
|
}
|
|
|
|
public function updateQuality(): void
|
|
{
|
|
foreach ($this->items as $item) {
|
|
$itemInstance = ItemFactory::createItem($item);
|
|
$itemInstance->updateSellIn($item);
|
|
$itemInstance->updateQuality($item);
|
|
}
|
|
}
|
|
}
|