Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
45 | 7 | public function pack(): PackedBoxList |
|
46 | { |
||
47 | 7 | $itemList = clone $this->items; |
|
48 | |||
49 | 7 | while(true) { |
|
50 | try { |
||
51 | 7 | return parent::pack(); |
|
52 | 2 | } catch (ItemTooLargeException $e) { |
|
53 | 2 | $this->unpackedItems->insert($e->getItem()); |
|
54 | 2 | $itemList->remove($e->getItem()); |
|
55 | 2 | $this->setItems($itemList); |
|
56 | } |
||
60 |