@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
| 168 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | || |
| 352 | 352 | $this->keepBrokenHtml |
| 353 | 353 | ) { |
| 354 | - $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>'; |
|
| 354 | + $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>'; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | $html = self::replaceToPreserveHtmlEntities($html); |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | /** @noinspection StringFragmentMisplacedInspection */ |
| 378 | 378 | if (\stripos('<?xml', $html) !== 0) { |
| 379 | 379 | $xmlHackUsed = true; |
| 380 | - $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
| 380 | + $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | $this->document->loadHTML($html, $optionsXml); |
@@ -910,11 +910,11 @@ discard block |
||
| 910 | 910 | |
| 911 | 911 | $html = (string) \preg_replace_callback( |
| 912 | 912 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
| 913 | - static function ($matches) { |
|
| 914 | - return $matches['start'] . |
|
| 915 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
| 916 | - $matches['value'] . |
|
| 917 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
| 913 | + static function($matches) { |
|
| 914 | + return $matches['start']. |
|
| 915 | + '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
| 916 | + $matches['value']. |
|
| 917 | + '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
| 918 | 918 | $matches['end']; |
| 919 | 919 | }, |
| 920 | 920 | $html |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | |
| 927 | 927 | $html = (string) \preg_replace_callback( |
| 928 | 928 | '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
| 929 | - static function ($matches) { |
|
| 929 | + static function($matches) { |
|
| 930 | 930 | $matches['broken'] = \str_replace( |
| 931 | 931 | ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
| 932 | 932 | ['</', '<', '>'], |
@@ -934,9 +934,9 @@ discard block |
||
| 934 | 934 | ); |
| 935 | 935 | |
| 936 | 936 | self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
| 937 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($matches['broken']); |
|
| 937 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper.\crc32($matches['broken']); |
|
| 938 | 938 | |
| 939 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
| 939 | + return $matches['start'].$matchesHash.$matches['end']; |
|
| 940 | 940 | }, |
| 941 | 941 | $html |
| 942 | 942 | ); |
@@ -958,13 +958,13 @@ discard block |
||
| 958 | 958 | { |
| 959 | 959 | // regEx for e.g.: [<script id="elements-image-1" type="text/html">...</script>] |
| 960 | 960 | $tags = implode('|', array_map( |
| 961 | - function ($value) { |
|
| 961 | + function($value) { |
|
| 962 | 962 | return preg_quote($value, '/'); |
| 963 | 963 | }, $this->specialScriptTags |
| 964 | 964 | )); |
| 965 | 965 | $html = (string) \preg_replace_callback( |
| 966 | - '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:' . $tags . ')+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU', |
|
| 967 | - function ($matches) { |
|
| 966 | + '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:'.$tags.')+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU', |
|
| 967 | + function($matches) { |
|
| 968 | 968 | |
| 969 | 969 | // Check for logic in special script tags, like [<% _.each(tierPrices, function(item, key) { %>], |
| 970 | 970 | // because often this looks like non valid html in the template itself. |
@@ -974,18 +974,18 @@ discard block |
||
| 974 | 974 | $matches['innerContent'] = \str_replace('<\/', '</', $matches['innerContent']); |
| 975 | 975 | |
| 976 | 976 | self::$domBrokenReplaceHelper['orig'][] = $matches['innerContent']; |
| 977 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '' . self::$domHtmlBrokenHtmlHelper . '' . \crc32($matches['innerContent']); |
|
| 977 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = ''.self::$domHtmlBrokenHtmlHelper.''.\crc32($matches['innerContent']); |
|
| 978 | 978 | |
| 979 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
| 979 | + return $matches['start'].$matchesHash.$matches['end']; |
|
| 980 | 980 | } |
| 981 | 981 | } |
| 982 | 982 | |
| 983 | 983 | // remove the html5 fallback |
| 984 | 984 | $matches[0] = \str_replace('<\/', '</', $matches[0]); |
| 985 | 985 | |
| 986 | - $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($matches[0], \strlen('<script')); |
|
| 986 | + $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($matches[0], \strlen('<script')); |
|
| 987 | 987 | |
| 988 | - return \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
| 988 | + return \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
| 989 | 989 | }, |
| 990 | 990 | $html |
| 991 | 991 | ); |