1 | <?php |
||
9 | class HtmlMatcher extends DiagnosingMatcher { |
||
10 | |||
11 | /** |
||
12 | * @link http://www.xmlsoft.org/html/libxml-xmlerror.html#xmlParserErrors |
||
13 | * @link https://github.com/Chronic-Dev/libxml2/blob/683f296a905710ff285c28b8644ef3a3d8be9486/include/libxml/xmlerror.h#L257 |
||
14 | */ |
||
15 | const XML_UNKNOWN_TAG_ERROR_CODE = 801; |
||
16 | |||
17 | /** |
||
18 | * @var Matcher |
||
19 | */ |
||
20 | private $elementMatcher; |
||
21 | |||
22 | /** |
||
23 | * @param Matcher $elementMatcher |
||
24 | * |
||
25 | * @return self |
||
26 | */ |
||
27 | 65 | public static function htmlPiece( Matcher $elementMatcher = null ) { |
|
30 | |||
31 | 65 | private function __construct( Matcher $elementMatcher = null ) { |
|
34 | |||
35 | 15 | public function describeTo( Description $description ) { |
|
41 | |||
42 | /** |
||
43 | * @param string $html |
||
44 | * @param Description $mismatchDescription |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | 65 | protected function matchesWithDiagnosticDescription( $html, Description $mismatchDescription ) { |
|
93 | |||
94 | /** |
||
95 | * @param \LibXMLError $error |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | 32 | private function isUnknownTagError( \LibXMLError $error ) { |
|
102 | |||
103 | /** |
||
104 | * @param string $html |
||
105 | * |
||
106 | * @return string HTML |
||
107 | */ |
||
108 | private function escapeScriptTagContents( $html ) { |
||
113 | |||
114 | } |
||
115 |