Completed
Push — master ( 53d220...15d6df )
by Doug
14:09
created

ItemTooLargeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10

2 Methods

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