Passed
Push — 2.x-dev ( e5166d...a75e6c )
by Doug
02:18
created

ItemTooLargeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
 *
6
 * @author Doug Wright
7
 */
8
9
namespace DVDoug\BoxPacker;
10
11
use RuntimeException;
12
13
/**
14
 * Class ItemTooLargeException
15
 * Exception used when an item is too large to pack.
16
 */
17
class ItemTooLargeException extends RuntimeException
18
{
19
    /** @var Item */
20
    public $item;
21
22
    /**
23
     * ItemTooLargeException constructor.
24
     *
25
     * @param string $message
26
     * @param Item   $item
27
     */
28 1
    public function __construct($message, Item $item)
29
    {
30 1
        $this->item = $item;
31 1
        parent::__construct($message);
32 1
    }
33
34
    /**
35
     * @return Item
36
     */
37 1
    public function getItem()
38
    {
39 1
        return $this->item;
40
    }
41
}
42