Passed
Push — 1.x ( 457fa0...308477 )
by Doug
03:11
created

NoBoxesAvailableException::getItem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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 3
    public function __construct($message, Item $item)
25
    {
26 3
        $this->item = $item;
27 3
        parent::__construct($message);
28 3
    }
29
30
    public function getItem()
31
    {
32
        return $this->item;
33
    }
34
}
35