Completed
Push — master ( d5be20...94ac26 )
by Doug
02:29
created

OrientatedItem::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
rs 9.4285
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
/**
3
 * Box packing (3D bin packing, knapsack problem)
4
 * @package BoxPacker
5
 * @author Doug Wright
6
 */
7
namespace DVDoug\BoxPacker;
8
9
/**
10
 * An item to be packed
11
 * @author Doug Wright
12
 * @package BoxPacker
13
 */
14
class OrientatedItem
15
{
16
17
    /**
18
     * @var Item
19
     */
20
    protected $item;
21
22
    /**
23
     * @var int
24
     */
25
    protected $width;
26
27
    /**
28
     * @var int
29
     */
30
    protected $length;
31
32
    /**
33
     * @var int
34
     */
35
    protected $depth;
36
37
    /**
38
     * Constructor.
39
     * @param Item $item
40
     * @param int $width
41
     * @param int $length
42
     * @param int $depth
43
     */
44
    public function __construct(Item $item, $width, $length, $depth) {
45
        $this->item = $item;
46
        $this->width = $width;
47
        $this->length = $length;
48
        $this->depth = $depth;
49
    }
50
51
    /**
52
     * Item
53
     * @return Item
54
     */
55
    public function getItem() {
56
        return $this->item;
57
    }
58
59
    /**
60
     * Item width in mm in it's packed orientation
61
     * @return int
62
     */
63
    public function getWidth() {
64
        return $this->width;
65
    }
66
67
    /**
68
     * Item length in mm in it's packed orientation
69
     * @return int
70
     */
71
    public function getLength() {
72
        return $this->length;
73
    }
74
75
    /**
76
     * Item depth in mm in it's packed orientation
77
     * @return int
78
     */
79
    public function getDepth() {
80
        return $this->depth;
81
    }
82
  }
83
84