Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 2 |
CRAP Score | 1.4705 |
Changes | 0 |
1 | <?php |
||
14 | 2 | private function if() |
|
15 | { |
||
16 | 2 | $search = "/{(\s?)+if(\s?)+([\$\w\.]+)(\s?)+([<>!=]+)(\s?)+([\$\w\d\.\"' ]+)(\s?)+}(.*?){(\s?)+\/if(\s?)+}/is"; |
|
17 | |||
18 | Tag::match($search, function($left, $op, $right, $content = "") { |
||
19 | |||
20 | $left = str_replace('.', '->', $left); |
||
21 | $right = str_replace('.', '->', $right); |
||
22 | |||
23 | $res = "<?php if ($left $op $right) { ?>"; |
||
24 | $res .= $content; |
||
25 | $res .= "<?php } ?>"; |
||
26 | |||
27 | Tag::replace($res); |
||
28 | |||
29 | $this->if(); |
||
30 | 2 | }); |
|
66 |