Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
14 | 8 | public function handle(array $match): string |
|
15 | { |
||
16 | 8 | static $count = 0; |
|
17 | |||
18 | 8 | $index = !empty($match[5]) && !empty($match[7]) |
|
19 | 4 | ? $match[7] |
|
20 | 8 | : 'index' . ++$count; |
|
21 | |||
22 | 8 | $replace = "<?php for (\$$index = 0; \$$index < $match[3]; \$$index++) { ?>"; |
|
23 | 8 | $replace .= $match[9]; |
|
24 | 8 | $replace .= "<?php } ?>"; |
|
25 | |||
26 | 8 | return $replace; |
|
27 | } |
||
29 |