| Conditions | 5 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public static function fromArray(array $packages): self |
||
| 30 | { |
||
| 31 | $parcel = Storage::fromArray($packages[0])->toArray(); |
||
| 32 | $subPackage = null; |
||
| 33 | $consumerUnit = null; |
||
| 34 | |||
| 35 | for ($i = 1; $i < 3; ++$i) { |
||
| 36 | if (null !== $packages[$i]) { |
||
| 37 | if (1 === $i) { |
||
| 38 | $subPackage = Storage::fromArray($packages[$i])->toArray(); |
||
| 39 | } |
||
| 40 | if (2 === $i) { |
||
| 41 | $consumerUnit = Storage::fromArray($packages[$i])->toArray(); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | return new self($parcel, $subPackage, $consumerUnit); |
||
| 47 | } |
||
| 64 |