Test Failed
Push — master ( 09012b...794d70 )
by Doug
04:43
created

NoBoxesAvailableException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 17
ccs 6
cts 6
cp 1
c 0
b 0
f 0
rs 10

2 Methods

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