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

GildedRose   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A update_quality() 0 7 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