Completed
Push — 2.x-dev ( 5f5b4d...48a1b4 )
by Doug
61:10 queued 51:42
created

TestItem   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 115
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 115
c 1
b 0
f 0
wmc 8
lcom 0
cbo 0
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 $keepFlat;
43
44
    /**
45
     * @var int
46
     */
47
    private $volume;
48
49
    /**
50
     * TestItem constructor.
51
     *
52
     * @param string $description
53
     * @param int    $width
54
     * @param int    $length
55
     * @param int    $depth
56
     * @param int    $weight
57
     * @param int    $keepFlat
58
     */
59
    public function __construct($description, $width, $length, $depth, $weight, $keepFlat)
60
    {
61
        $this->description = $description;
62
        $this->width = $width;
63
        $this->length = $length;
64
        $this->depth = $depth;
65
        $this->weight = $weight;
66
        $this->keepFlat = $keepFlat;
67
68
        $this->volume = $this->width * $this->length * $this->depth;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getDescription()
75
    {
76
        return $this->description;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getWidth()
83
    {
84
        return $this->width;
85
    }
86
87
    /**
88
     * @return int
89
     */
90
    public function getLength()
91
    {
92
        return $this->length;
93
    }
94
95
    /**
96
     * @return int
97
     */
98
    public function getDepth()
99
    {
100
        return $this->depth;
101
    }
102
103
    /**
104
     * @return int
105
     */
106
    public function getWeight()
107
    {
108
        return $this->weight;
109
    }
110
111
    /**
112
     * @return int
113
     */
114
    public function getVolume()
115
    {
116
        return $this->volume;
117
    }
118
119
    /**
120
     * @return int
121
     */
122
    public function getKeepFlat()
123
    {
124
        return $this->keepFlat;
125
    }
126
}
127