@@ -151,7 +151,7 @@ |
||
151 | 151 | /** @noinspection StringFragmentMisplacedInspection */ |
152 | 152 | if (\stripos('<?xml', $xml) !== 0) { |
153 | 153 | $xmlHackUsed = true; |
154 | - $xml = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $xml; |
|
154 | + $xml = '<?xml encoding="'.$this->getEncoding().'" ?>'.$xml; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | $this->document->loadXML($xml, $optionsXml); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
125 | 125 | } |
126 | 126 | |
127 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
127 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | || |
289 | 289 | $this->keepBrokenHtml |
290 | 290 | ) { |
291 | - $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
291 | + $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $html = self::replaceToPreserveHtmlEntities($html); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | /** @noinspection StringFragmentMisplacedInspection */ |
311 | 311 | if (\stripos('<?xml', $html) !== 0) { |
312 | 312 | $xmlHackUsed = true; |
313 | - $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
313 | + $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | $this->document->loadHTML($html, $optionsXml); |
@@ -716,14 +716,14 @@ discard block |
||
716 | 716 | self::$domReplaceHelper['orig'] |
717 | 717 | ); |
718 | 718 | |
719 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
720 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
719 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
720 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
721 | 721 | |
722 | 722 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
723 | 723 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
724 | 724 | |
725 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
726 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
725 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
726 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
727 | 727 | |
728 | 728 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
729 | 729 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
@@ -869,11 +869,11 @@ discard block |
||
869 | 869 | |
870 | 870 | $html = (string) \preg_replace_callback( |
871 | 871 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
872 | - static function ($matches) { |
|
873 | - return $matches['start'] . |
|
874 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
875 | - $matches['value'] . |
|
876 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
872 | + static function($matches) { |
|
873 | + return $matches['start']. |
|
874 | + '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
875 | + $matches['value']. |
|
876 | + '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
877 | 877 | $matches['end']; |
878 | 878 | }, |
879 | 879 | $html |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | |
886 | 886 | $html = (string) \preg_replace_callback( |
887 | 887 | '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
888 | - static function ($matches) { |
|
888 | + static function($matches) { |
|
889 | 889 | $matches['broken'] = \str_replace( |
890 | 890 | ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
891 | 891 | ['</', '<', '>'], |
@@ -893,9 +893,9 @@ discard block |
||
893 | 893 | ); |
894 | 894 | |
895 | 895 | self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
896 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . \crc32($matches['broken']); |
|
896 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.\crc32($matches['broken']); |
|
897 | 897 | |
898 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
898 | + return $matches['start'].$matchesHash.$matches['end']; |
|
899 | 899 | }, |
900 | 900 | $html |
901 | 901 | ); |
@@ -920,8 +920,8 @@ discard block |
||
920 | 920 | |
921 | 921 | if (isset($specialScripts[0])) { |
922 | 922 | foreach ($specialScripts[0] as $specialScript) { |
923 | - $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($specialScript, \strlen('<script')); |
|
924 | - $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
923 | + $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($specialScript, \strlen('<script')); |
|
924 | + $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
925 | 925 | // remove the html5 fallback |
926 | 926 | $specialNonScript = \str_replace('<\/', '</', $specialNonScript); |
927 | 927 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
84 | 84 | } |
85 | 85 | |
86 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
86 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -389,12 +389,12 @@ discard block |
||
389 | 389 | $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU'; |
390 | 390 | $htmlTmp = \preg_replace_callback( |
391 | 391 | $regExSpecialScript, |
392 | - static function ($scripts) { |
|
392 | + static function($scripts) { |
|
393 | 393 | if (empty($scripts['content'])) { |
394 | 394 | return $scripts[0]; |
395 | 395 | } |
396 | 396 | |
397 | - return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/', $scripts['content']) . '</script>'; |
|
397 | + return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>'; |
|
398 | 398 | }, |
399 | 399 | $html |
400 | 400 | ); |
@@ -423,14 +423,14 @@ discard block |
||
423 | 423 | self::$domReplaceHelper['orig'] |
424 | 424 | ); |
425 | 425 | |
426 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
427 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
426 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
427 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
428 | 428 | |
429 | 429 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
430 | 430 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
431 | 431 | |
432 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
433 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
432 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
433 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
434 | 434 | |
435 | 435 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
436 | 436 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |