Completed
Push — 2.x-dev ( 266dac...34f8fe )
by Doug
10:05
created

ItemTooLargeException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 25
ccs 3
cts 5
cp 0.6
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
namespace DVDoug\BoxPacker;
9
10
/**
11
 * Class ItemTooLargeException
12
 * Exception used when an item is too large to pack
13
 *
14
 * @package DVDoug\BoxPacker
15
 */
16
class ItemTooLargeException extends \RuntimeException
17
{
18
19
    /** @var Item */
20
    public $item;
21
22
    /**
23
     * ItemTooLargeException constructor.
24
     *
25
     * @param string $message
26
     * @param Item   $item
27
     */
28 2
    public function __construct($message, Item $item) {
29 2
        $this->item = $item;
30 2
        parent::__construct($message);
31
    }
32
33
    /**
34
     * @return Item
35
     */
36
    public function getItem() {
37
        return $this->item;
38
    }
39
40
}
41