Passed
Pull Request — master (#344)
by
unknown
05:27 queued 03:46
created

NoBoxesAvailableException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 10
ccs 0
cts 4
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAffectedItems() 0 3 1
A __construct() 0 3 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\ItemList;
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
    public function __construct(string $message, private ItemList $itemList)
22
    {
23
        parent::__construct($message);
24
    }
25
26
    public function getAffectedItems(): ItemList
27
    {
28
        return $this->itemList;
29
    }
30
}
31