Test Failed
Push — 2.x-dev ( 5e90af...eccc16 )
by Doug
03:16
created

NoBoxesAvailableException::__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 1
Bugs 0 Features 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 1
b 0
f 0
1
<?php
2
3
/**
4
 * Box packing (3D bin packing, knapsack problem).
5
 *
6
 * @author Doug Wright
7
 */
8
namespace DVDoug\BoxPacker;
9
10
use RuntimeException;
11
12
/**
13
 * Class NoBoxesAvailableException
14
 * Exception used when an item cannot be packed into any box.
15
 */
16
class NoBoxesAvailableException extends RuntimeException
17
{
18
    /** @var Item */
19
    public $item;
20
21
    /**
22
     * NoBoxesAvailableException constructor.
23
     */
24 2
    public function __construct($message, Item $item)
25
    {
26 2
        $this->item = $item;
27 2
        parent::__construct($message);
28 2
    }
29
30
    public function getItem()
31
    {
32
        return $this->item;
33
    }
34
}
35