Completed
Push — GildedRose/php ( 8e5d5b )
by
unknown
04:03
created

Item   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 3 1
1
<?php
2
3
namespace Kata\GildedRoseKata;
4
5
class Item {
6
7
    public $name;
8
    public $sell_in;
9
    public $quality;
10
11 1
    function __construct($name, $sell_in, $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...
12 1
        $this->name = $name;
13 1
        $this->sell_in = $sell_in;
14 1
        $this->quality = $quality;
15 1
    }
16
17
    public function __toString() {
18
        return "{$this->name}, {$this->sell_in}, {$this->quality}";
19
    }
20
}
21