Passed
Push — 1.x-dev ( 9106e4...cc1b76 )
by Doug
02:13
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
lcom 0
cbo 0
dl 0
loc 25
ccs 6
cts 6
cp 1
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getItem() 0 4 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
/**
12
 * Class ItemTooLargeException
13
 * Exception used when an item is too large to pack.
14
 */
15
class ItemTooLargeException extends \RuntimeException
16
{
17
    /** @var Item */
18
    public $item;
19
20
    /**
21
     * ItemTooLargeException constructor.
22
     *
23
     * @param string $message
24
     * @param Item   $item
25
     */
26 1
    public function __construct($message, Item $item)
27
    {
28 1
        $this->item = $item;
29 1
        parent::__construct($message);
30 1
    }
31
32
    /**
33
     * @return Item
34
     */
35 1
    public function getItem()
36
    {
37 1
        return $this->item;
38
    }
39
}
40