Conditions | 6 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
26 | public function map(array $parts): array |
||
27 | { |
||
28 | $last = count($parts) - 1; |
||
29 | |||
30 | foreach ($parts as $k => $part) { |
||
31 | if ($part instanceof AbstractPart) { |
||
32 | continue; |
||
33 | } |
||
34 | |||
35 | if (!$this->matchLastPart && $k === $last) { |
||
36 | continue; |
||
37 | } |
||
38 | |||
39 | if ($this->isInitial($part)) { |
||
40 | $parts[$k] = new Initial($part); |
||
41 | } |
||
42 | } |
||
43 | |||
44 | return $parts; |
||
45 | } |
||
46 | |||
62 |