Completed
Push — GildedRose/AlbertAndMarcos ( 1b8f5c...9da94d )
by Albert
02:15
created

GildedRose::updateQuality()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
namespace Kata\GildedRoseKata;
4
5
class GildedRose
6
{
7
    /** @var Item[] */
8
    private $items;
9
10 15
    public function __construct(array $items)
11
    {
12 15
        $this->items = $items;
13 15
    }
14
15 15
    public function updateQuality()
16
    {
17 15
        foreach ($this->items as $item) {
18 15
            $internal_item = ItemFactory::fromItem($item);
19 15
            $internal_item->updateQualityByDayPassed();
20
        }
21 15
    }
22
}
23