mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Formatted intellephesnse and documented
processing unit.
This commit is contained in:
parent
7c4100b08b
commit
c956700c9c
@ -1,17 +1,54 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7
|
||||||
|
*
|
||||||
|
* @category Scientific_R&D
|
||||||
|
* @package Food_LIFO
|
||||||
|
* @author Povilas Brilius <pbrilius@gmail.com>
|
||||||
|
* @license eupl-1.1 https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository
|
||||||
|
* @link pbgroupeu.wordpress.com
|
||||||
|
*/
|
||||||
|
|
||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
final class GildedRose {
|
/**
|
||||||
|
* Items processing unit
|
||||||
|
*
|
||||||
|
* @category Accountancy
|
||||||
|
* @package Timeline_Graph
|
||||||
|
* @author Povilas Brilius <pbrilius@gmail.com>
|
||||||
|
* @license eupl-1.1 https://help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository
|
||||||
|
* @link pbgroupeu.wordpress.com
|
||||||
|
*/
|
||||||
|
final class GildedRose
|
||||||
|
{
|
||||||
|
|
||||||
private $items = [];
|
/**
|
||||||
|
* Stock items
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $_items = [];
|
||||||
|
|
||||||
public function __construct($items) {
|
/**
|
||||||
$this->items = $items;
|
* Constructor with items
|
||||||
|
*
|
||||||
|
* @param array $items stock
|
||||||
|
*/
|
||||||
|
public function __construct(array $items)
|
||||||
|
{
|
||||||
|
$this->_items = $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateQuality() {
|
/**
|
||||||
foreach ($this->items as $item) {
|
* Advance by a time frame of 1 day
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function updateQuality()
|
||||||
|
{
|
||||||
|
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') {
|
||||||
@ -60,4 +97,3 @@ final class GildedRose {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user