@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | /** |
| 376 | 376 | * Returns the first child of node. |
| 377 | 377 | * |
| 378 | - * @return SimpleXmlDomInterface|null |
|
| 378 | + * @return null|SimpleXmlDom |
|
| 379 | 379 | */ |
| 380 | 380 | public function firstChild() |
| 381 | 381 | { |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | /** |
| 534 | 534 | * Returns the last child of node. |
| 535 | 535 | * |
| 536 | - * @return SimpleXmlDomInterface|null |
|
| 536 | + * @return null|SimpleXmlDom |
|
| 537 | 537 | */ |
| 538 | 538 | public function lastChild() |
| 539 | 539 | { |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | /** |
| 551 | 551 | * Returns the next sibling of node. |
| 552 | 552 | * |
| 553 | - * @return SimpleXmlDomInterface|null |
|
| 553 | + * @return null|SimpleXmlDom |
|
| 554 | 554 | */ |
| 555 | 555 | public function nextSibling() |
| 556 | 556 | { |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | /** |
| 578 | 578 | * Returns the previous sibling of node. |
| 579 | 579 | * |
| 580 | - * @return SimpleXmlDomInterface|null |
|
| 580 | + * @return null|SimpleXmlDom |
|
| 581 | 581 | */ |
| 582 | 582 | public function previousSibling() |
| 583 | 583 | { |
@@ -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 | /** |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU'; |
| 376 | 376 | $html = \preg_replace_callback( |
| 377 | 377 | $regExSpecialScript, |
| 378 | - static function ($scripts) { |
|
| 379 | - return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/', $scripts['content']) . '</script>'; |
|
| 378 | + static function($scripts) { |
|
| 379 | + return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>'; |
|
| 380 | 380 | }, |
| 381 | 381 | $html |
| 382 | 382 | ); |
@@ -401,14 +401,14 @@ discard block |
||
| 401 | 401 | self::$domReplaceHelper['orig'] |
| 402 | 402 | ); |
| 403 | 403 | |
| 404 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
| 405 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 404 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
| 405 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
| 406 | 406 | |
| 407 | 407 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
| 408 | 408 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
| 409 | 409 | |
| 410 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
| 411 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 410 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
| 411 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 412 | 412 | |
| 413 | 413 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
| 414 | 414 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
@@ -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 | /** |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | || |
| 283 | 283 | $this->keepBrokenHtml |
| 284 | 284 | ) { |
| 285 | - $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 285 | + $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $html = self::replaceToPreserveHtmlEntities($html); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $xmlHackUsed = false; |
| 304 | 304 | if (\stripos('<?xml', $html) !== 0) { |
| 305 | 305 | $xmlHackUsed = true; |
| 306 | - $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
| 306 | + $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | $this->document->loadHTML($html, $optionsXml); |
@@ -673,14 +673,14 @@ discard block |
||
| 673 | 673 | self::$domReplaceHelper['orig'] |
| 674 | 674 | ); |
| 675 | 675 | |
| 676 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
| 677 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 676 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
| 677 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
| 678 | 678 | |
| 679 | 679 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
| 680 | 680 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
| 681 | 681 | |
| 682 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
| 683 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 682 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
| 683 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 684 | 684 | |
| 685 | 685 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
| 686 | 686 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
@@ -826,11 +826,11 @@ discard block |
||
| 826 | 826 | |
| 827 | 827 | $html = (string) \preg_replace_callback( |
| 828 | 828 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
| 829 | - static function ($matches) { |
|
| 830 | - return $matches['start'] . |
|
| 831 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
| 832 | - $matches['value'] . |
|
| 833 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
| 829 | + static function($matches) { |
|
| 830 | + return $matches['start']. |
|
| 831 | + '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
| 832 | + $matches['value']. |
|
| 833 | + '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
| 834 | 834 | $matches['end']; |
| 835 | 835 | }, |
| 836 | 836 | $html |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | |
| 843 | 843 | $html = (string) \preg_replace_callback( |
| 844 | 844 | '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
| 845 | - static function ($matches) { |
|
| 845 | + static function($matches) { |
|
| 846 | 846 | $matches['broken'] = \str_replace( |
| 847 | 847 | ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
| 848 | 848 | ['</', '<', '>'], |
@@ -850,9 +850,9 @@ discard block |
||
| 850 | 850 | ); |
| 851 | 851 | |
| 852 | 852 | self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
| 853 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . \crc32($matches['broken']); |
|
| 853 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.\crc32($matches['broken']); |
|
| 854 | 854 | |
| 855 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
| 855 | + return $matches['start'].$matchesHash.$matches['end']; |
|
| 856 | 856 | }, |
| 857 | 857 | $html |
| 858 | 858 | ); |
@@ -877,8 +877,8 @@ discard block |
||
| 877 | 877 | |
| 878 | 878 | if (isset($specialScripts[0])) { |
| 879 | 879 | foreach ($specialScripts[0] as $specialScript) { |
| 880 | - $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($specialScript, \strlen('<script')); |
|
| 881 | - $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 880 | + $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($specialScript, \strlen('<script')); |
|
| 881 | + $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 882 | 882 | // remove the html5 fallback |
| 883 | 883 | $specialNonScript = \str_replace('<\/', '</', $specialNonScript); |
| 884 | 884 | |