@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
| 192 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | || |
| 364 | 364 | $this->keepBrokenHtml |
| 365 | 365 | ) { |
| 366 | - $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 366 | + $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | $html = self::replaceToPreserveHtmlEntities($html); |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $xmlHackUsed = false; |
| 385 | 385 | if (\stripos('<?xml', $html) !== 0) { |
| 386 | 386 | $xmlHackUsed = true; |
| 387 | - $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
| 387 | + $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | $this->document->loadHTML($html, $optionsXml); |
@@ -802,8 +802,8 @@ discard block |
||
| 802 | 802 | $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU'; |
| 803 | 803 | $html = \preg_replace_callback( |
| 804 | 804 | $regExSpecialScript, |
| 805 | - static function ($scripts) { |
|
| 806 | - return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/', $scripts['content']) . '</script>'; |
|
| 805 | + static function($scripts) { |
|
| 806 | + return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>'; |
|
| 807 | 807 | }, |
| 808 | 808 | $html |
| 809 | 809 | ); |
@@ -842,11 +842,11 @@ discard block |
||
| 842 | 842 | |
| 843 | 843 | $html = (string) \preg_replace_callback( |
| 844 | 844 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
| 845 | - static function ($matches) { |
|
| 846 | - return $matches['start'] . |
|
| 847 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
| 848 | - $matches['value'] . |
|
| 849 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
| 845 | + static function($matches) { |
|
| 846 | + return $matches['start']. |
|
| 847 | + '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
| 848 | + $matches['value']. |
|
| 849 | + '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
| 850 | 850 | $matches['end']; |
| 851 | 851 | }, |
| 852 | 852 | $html |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | |
| 859 | 859 | $html = (string) \preg_replace_callback( |
| 860 | 860 | '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
| 861 | - static function ($matches) { |
|
| 861 | + static function($matches) { |
|
| 862 | 862 | $matches['broken'] = \str_replace( |
| 863 | 863 | ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
| 864 | 864 | ['</', '<', '>'], |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | ); |
| 867 | 867 | |
| 868 | 868 | self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
| 869 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . \crc32($matches['broken']); |
|
| 869 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.\crc32($matches['broken']); |
|
| 870 | 870 | |
| 871 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
| 871 | + return $matches['start'].$matchesHash.$matches['end']; |
|
| 872 | 872 | }, |
| 873 | 873 | $html |
| 874 | 874 | ); |
@@ -893,8 +893,8 @@ discard block |
||
| 893 | 893 | |
| 894 | 894 | if (isset($specialScripts[0])) { |
| 895 | 895 | foreach ($specialScripts[0] as $specialScript) { |
| 896 | - $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($specialScript, \strlen('<script')); |
|
| 897 | - $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 896 | + $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($specialScript, \strlen('<script')); |
|
| 897 | + $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 898 | 898 | // remove the html5 fallback |
| 899 | 899 | $specialNonScript = \str_replace('<\/', '</', $specialNonScript); |
| 900 | 900 | |
@@ -975,14 +975,14 @@ discard block |
||
| 975 | 975 | self::$domReplaceHelper['orig'] |
| 976 | 976 | ); |
| 977 | 977 | |
| 978 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
| 979 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 978 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
| 979 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
| 980 | 980 | |
| 981 | 981 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
| 982 | 982 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
| 983 | 983 | |
| 984 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
| 985 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 984 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
| 985 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 986 | 986 | |
| 987 | 987 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
| 988 | 988 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | $xmlHackUsed = false; |
| 98 | 98 | if (\stripos('<?xml', $xml) !== 0) { |
| 99 | 99 | $xmlHackUsed = true; |
| 100 | - $xml = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $xml; |
|
| 100 | + $xml = '<?xml encoding="'.$this->getEncoding().'" ?>'.$xml; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $this->document->loadXML($xml, $optionsXml); |