Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
17 | 6 | public function parse($html) |
|
18 | { |
||
19 | 6 | $startPos = 3; |
|
20 | 6 | if (mb_substr($html, 0, 5) == '<?php') { |
|
21 | 6 | $startPos = 6; |
|
22 | 6 | } |
|
23 | |||
24 | 6 | $posOfEndOfPhp = mb_strpos($html, '?>'); |
|
25 | 6 | if ($posOfEndOfPhp === false) { |
|
26 | 1 | $this->value = trim(mb_substr($html, $startPos)); |
|
27 | |||
28 | 1 | return ''; |
|
29 | } |
||
30 | |||
31 | 5 | $this->value = trim(mb_substr($html, $startPos, $posOfEndOfPhp - $startPos - 1)); |
|
32 | |||
33 | 5 | return trim(mb_substr($html, $posOfEndOfPhp + 2)); |
|
34 | } |
||
35 | |||
54 |