Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
15 | 8 | protected function processStrings(array $strings) |
|
16 | { |
||
17 | 8 | if (!$this->isEligible($strings)) |
|
18 | { |
||
19 | 3 | return $strings; |
|
20 | } |
||
21 | |||
22 | 5 | $newString = []; |
|
23 | 5 | while ($this->hasMatchingSuffix($strings)) |
|
24 | { |
||
25 | 5 | array_unshift($newString, end($strings[0])); |
|
26 | 5 | $i = count($strings); |
|
27 | 5 | while (--$i >= 0) |
|
28 | { |
||
29 | 5 | array_pop($strings[$i]); |
|
30 | } |
||
31 | } |
||
32 | 5 | array_unshift($newString, $strings); |
|
33 | |||
34 | 5 | return [$newString]; |
|
35 | } |
||
36 | |||
67 | } |