Passed
Push — 2.x-dev ( e5166d...a75e6c )
by Doug
02:18
created

ItemTooLargeException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Box packing (3D bin packing, knapsack problem).
5
 *
6
 * @author Doug Wright
7
 */
8
9
namespace DVDoug\BoxPacker;
10
11
use RuntimeException;
12
13
/**
14
 * Class ItemTooLargeException
15
 * Exception used when an item is too large to pack.
16
 */
17
class ItemTooLargeException extends RuntimeException
18
{
19
    /** @var Item */
20
    public $item;
21
22
    /**
23
     * ItemTooLargeException constructor.
24
     *
25
     * @param string $message
26
     * @param Item   $item
27
     */
28 1
    public function __construct($message, Item $item)
29
    {
30 1
        $this->item = $item;
31 1
        parent::__construct($message);
32 1
    }
33
34
    /**
35
     * @return Item
36
     */
37 1
    public function getItem()
38
    {
39 1
        return $this->item;
40
    }
41
}
42