| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | public static function fromArray(array $packages): self |
||
| 44 | { |
||
| 45 | $parcel = Storage::fromArray($packages[0])->toArray(); |
||
| 46 | $subPackage = null; |
||
| 47 | $consumerUnit = null; |
||
| 48 | |||
| 49 | for ($iteration = 1; $iteration < 3; ++$iteration) { |
||
| 50 | if (null !== $packages[$iteration]) { |
||
| 51 | if (1 == $iteration) { |
||
| 52 | $subPackage = Storage::fromArray($packages[$iteration])->toArray(); |
||
| 53 | } |
||
| 54 | if (2 == $iteration) { |
||
| 55 | $consumerUnit = Storage::fromArray($packages[$iteration])->toArray(); |
||
| 56 | } |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | return new self($parcel, $subPackage, $consumerUnit); |
||
| 61 | } |
||
| 62 | |||
| 78 |