Completed
Push — GildedRose/AlbertAndMarcos ( c4eed1 )
by Albert
02:33
created

GildedRose::update_quality()   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 1
Bugs 0 Features 0
Metric Value
c 1
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
    function __construct(array $items)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
11
    {
12 15
        $this->items = $items;
13 15
    }
14
15 15
    function update_quality()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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
24
25