| Total Complexity | 9 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class InfalliblePacker extends Packer |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var ItemList |
||
| 20 | */ |
||
| 21 | protected $unpackedItems; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * InfalliblePacker constructor. |
||
| 25 | */ |
||
| 26 | public function __construct() |
||
| 27 | { |
||
| 28 | $this->unpackedItems = new ItemList(); |
||
| 29 | parent::__construct(); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Return the items that couldn't be packed. |
||
| 34 | */ |
||
| 35 | public function getUnpackedItems(): ItemList |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function pack(): PackedBoxList |
||
| 65 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: