Conditions | 8 |
Paths | 5 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public static function merge($tokens, $cond1EndIndex, $cond2StartIndex, $if2BodyEndIndex) |
||
8 | { |
||
9 | $newTokens = []; |
||
10 | foreach ($tokens as $i => $oldToken) { |
||
11 | if ($i == $cond1EndIndex) { |
||
12 | $newTokens[] = [T_WHITESPACE, ' ']; |
||
13 | $newTokens[] = [T_BOOLEAN_AND, '&&']; |
||
14 | $newTokens[] = [T_WHITESPACE, ' ']; |
||
15 | continue; |
||
16 | } |
||
17 | |||
18 | if ($i > $cond1EndIndex && $i <= $cond2StartIndex) { |
||
19 | continue; |
||
20 | } |
||
21 | |||
22 | if ($i == $if2BodyEndIndex || ($i == $if2BodyEndIndex + 1 && $oldToken == ';')) { |
||
23 | continue; |
||
24 | } |
||
25 | $newTokens[] = $oldToken; |
||
26 | } |
||
27 | |||
28 | return $newTokens; |
||
29 | } |
||
30 | } |
||
31 |