Passed
Pull Request — master (#549)
by
unknown
15:13 queued 13:32
created

NoBoxesAvailableException::getAffectedItems()   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 0
Metric Value
cc 1
eloc 1
c 0
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
declare(strict_types=1);
9
10
namespace DVDoug\BoxPacker\Exception;
11
12
use DVDoug\BoxPacker\ItemList;
13
use RuntimeException;
14
15
/**
16
 * Exception used when an item cannot be packed into any box.
17
 */
18
class NoBoxesAvailableException extends RuntimeException
19
{
20
    public function __construct(string $message, private readonly ItemList $itemList)
21
    {
22
        parent::__construct($message);
23
    }
24
25
    public function getAffectedItems(): ItemList
26
    {
27
        return $this->itemList;
28
    }
29
}
30