| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 10 | public function handle(array $match): string |
|
| 17 | { |
||
| 18 | 10 | $filters = explode('|', $match[5]); |
|
| 19 | |||
| 20 | 10 | $res = "<?= "; |
|
| 21 | |||
| 22 | 10 | foreach ($filters as $filter) { |
|
| 23 | 10 | $res .= "$filter("; |
|
| 24 | } |
||
| 25 | |||
| 26 | 10 | $res .= $this->getVar(); |
|
| 27 | |||
| 28 | 10 | foreach ($filters as $filter) { |
|
| 29 | 10 | $res .= ")"; |
|
| 30 | } |
||
| 31 | |||
| 32 | 10 | $res .= " ?>"; |
|
| 33 | |||
| 34 | 10 | return $res; |
|
| 35 | } |
||
| 52 |
If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration: