| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 19 | 8 | public function parse($html) |
|
| 20 | { |
||
| 21 | 8 | $posOfEndOfComment = strpos($html, '-->'); |
|
| 22 | 8 | if ($posOfEndOfComment === false) { |
|
| 23 | 2 | if ($this->getThrowOnError()) { |
|
| 24 | 1 | throw new ParseException('Invalid comment.'); |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | return ''; |
|
| 28 | } |
||
| 29 | |||
| 30 | 6 | $this->value = trim(substr($html, 4, $posOfEndOfComment - 4)); |
|
| 31 | |||
| 32 | 6 | return trim(substr($html, $posOfEndOfComment + 3)); |
|
| 33 | } |
||
| 34 | |||
| 54 |