Passed
Push — 1.x-dev ( 9106e4...cc1b76 )
by Doug
02:13
created

TestItem   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 7
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 100
rs 10
1
<?php
2
/**
3
 * Box packing (3D bin packing, knapsack problem).
4
 *
5
 * @author Doug Wright
6
 */
7
8
namespace DVDoug\BoxPacker\Test;
9
10
use DVDoug\BoxPacker\Item;
11
12
class TestItem implements Item
13
{
14
    /**
15
     * @var string
16
     */
17
    private $description;
18
19
    /**
20
     * @var int
21
     */
22
    private $width;
23
24
    /**
25
     * @var int
26
     */
27
    private $length;
28
29
    /**
30
     * @var int
31
     */
32
    private $depth;
33
34
    /**
35
     * @var int
36
     */
37
    private $weight;
38
39
    /**
40
     * @var int
41
     */
42
    private $volume;
43
44
    /**
45
     * TestItem constructor.
46
     *
47
     * @param string $description
48
     * @param int    $width
49
     * @param int    $length
50
     * @param int    $depth
51
     * @param int    $weight
52
     */
53
    public function __construct($description, $width, $length, $depth, $weight)
54
    {
55
        $this->description = $description;
56
        $this->width = $width;
57
        $this->length = $length;
58
        $this->depth = $depth;
59
        $this->weight = $weight;
60
61
        $this->volume = $this->width * $this->length * $this->depth;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getDescription()
68
    {
69
        return $this->description;
70
    }
71
72
    /**
73
     * @return int
74
     */
75
    public function getWidth()
76
    {
77
        return $this->width;
78
    }
79
80
    /**
81
     * @return int
82
     */
83
    public function getLength()
84
    {
85
        return $this->length;
86
    }
87
88
    /**
89
     * @return int
90
     */
91
    public function getDepth()
92
    {
93
        return $this->depth;
94
    }
95
96
    /**
97
     * @return int
98
     */
99
    public function getWeight()
100
    {
101
        return $this->weight;
102
    }
103
104
    /**
105
     * @return int
106
     */
107
    public function getVolume()
108
    {
109
        return $this->volume;
110
    }
111
}
112