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

Item::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
crap 2
1
<?php
2
3
namespace Kata\GildedRoseKata;
4
5
final class Item {
6
7
    public $name;
8
    public $sell_in;
9
    public $quality;
10
11
    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
        $this->name = $name;
13
        $this->sell_in = $sell_in;
14
        $this->quality = $quality;
15
    }
16
17
    public function __toString() {
18
        return "{$this->name}, {$this->sell_in}, {$this->quality}";
19
    }
20
}
21