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