1 | <?php |
||
10 | class HtmlValidatorPanel extends AbstractSubscriablePanel implements IAjaxPanel |
||
11 | { |
||
12 | /** |
||
13 | * $html. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $html; |
||
18 | |||
19 | /** |
||
20 | * $ignoreErrors. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected static $ignoreErrors = [ |
||
25 | // XML_ERR_ENTITYREF_SEMICOL_MISSING |
||
26 | 23, |
||
27 | // XML_HTML_UNKNOWN_TAG |
||
28 | 801, |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * $severenity. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected static $severenity = [ |
||
37 | LIBXML_ERR_WARNING => 'Warning', |
||
38 | LIBXML_ERR_ERROR => 'Error', |
||
39 | LIBXML_ERR_FATAL => 'Fatal error', |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * setHTML. |
||
44 | * |
||
45 | * @param string $html |
||
46 | * @return $this |
||
47 | */ |
||
48 | 1 | public function setHtml($html) |
|
54 | |||
55 | /** |
||
56 | * Removes special controls characters and normalizes line endings and spaces. |
||
57 | * |
||
58 | * @param string $str |
||
59 | * @return string |
||
60 | */ |
||
61 | 1 | protected static function normalize($str) |
|
73 | |||
74 | /** |
||
75 | * Standardize line endings to unix-like. |
||
76 | * |
||
77 | * @param string $s |
||
78 | * @return string |
||
79 | */ |
||
80 | 1 | protected static function normalizeNewLines($s) |
|
84 | |||
85 | /** |
||
86 | * getAttributes. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | 1 | protected function getAttributes() |
|
115 | |||
116 | /** |
||
117 | * subscribe. |
||
118 | **/ |
||
119 | 1 | protected function subscribe() |
|
126 | } |
||
127 |