| 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 | 6 | public function parse($html) |
|
| 20 | { |
||
| 21 | 6 | $posOfEndOfCData = strpos($html, ']]>'); |
|
| 22 | 6 | if ($posOfEndOfCData === false) { |
|
| 23 | 2 | if ($this->getThrowOnError()) { |
|
| 24 | 1 | throw new ParseException('Invalid CDATA.'); |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | return ''; |
|
| 28 | } |
||
| 29 | |||
| 30 | 4 | $this->value = trim(substr($html, 9, $posOfEndOfCData - 9)); |
|
| 31 | |||
| 32 | 4 | return trim(substr($html, $posOfEndOfCData + 3)); |
|
| 33 | } |
||
| 34 | |||
| 53 |