| 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 |
||
| 43 | 7 | public function pack(): PackedBoxList |
|
| 44 | { |
||
| 45 | 7 | $itemList = clone $this->items; |
|
| 46 | |||
| 47 | 7 | while (true) { |
|
| 48 | try { |
||
| 49 | 7 | return parent::pack(); |
|
| 50 | 2 | } catch (ItemTooLargeException $e) { |
|
| 51 | 2 | $this->unpackedItems->insert($e->getItem()); |
|
| 52 | 2 | $itemList->remove($e->getItem()); |
|
| 53 | 2 | $this->setItems($itemList); |
|
| 54 | } |
||
| 58 |