Completed
Push — master ( 29d020...693ab0 )
by Lars
01:48
created
src/voku/helper/HtmlDomParser.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
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
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         if (\stripos($html, '</html>') !== false) {
314 314
             /** @noinspection NestedPositiveIfStatementsInspection */
315 315
             if (\preg_match('/<\/html>(.*?)/suiU', $html, $matches_after_html)) {
316
-                $html = \str_replace($matches_after_html[0], $matches_after_html[1] . '</html>', $html);
316
+                $html = \str_replace($matches_after_html[0], $matches_after_html[1].'</html>', $html);
317 317
             }
318 318
         }
319 319
 
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             ||
358 358
             $this->keepBrokenHtml
359 359
         ) {
360
-            $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>';
360
+            $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>';
361 361
         }
362 362
 
363 363
         $html = self::replaceToPreserveHtmlEntities($html);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
             /** @noinspection StringFragmentMisplacedInspection */
384 384
             if (\stripos('<?xml', $html) !== 0) {
385 385
                 $xmlHackUsed = true;
386
-                $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html;
386
+                $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html;
387 387
             }
388 388
 
389 389
             $this->document->loadHTML($html, $optionsXml);
@@ -944,11 +944,11 @@  discard block
 block discarded – undo
944 944
 
945 945
             $html = (string) \preg_replace_callback(
946 946
                 '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui',
947
-                static function ($matches) {
948
-                    return $matches['start'] .
949
-                        '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' .
950
-                        $matches['value'] .
951
-                        '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' .
947
+                static function($matches) {
948
+                    return $matches['start'].
949
+                        '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'.
950
+                        $matches['value'].
951
+                        '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'.
952 952
                         $matches['end'];
953 953
                 },
954 954
                 $html
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 
961 961
             $html = (string) \preg_replace_callback(
962 962
                 '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u',
963
-                static function ($matches) {
963
+                static function($matches) {
964 964
                     $matches['broken'] = \str_replace(
965 965
                         ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'],
966 966
                         ['</', '<', '>'],
@@ -968,9 +968,9 @@  discard block
 block discarded – undo
968 968
                     );
969 969
 
970 970
                     self::$domBrokenReplaceHelper['orig'][] = $matches['broken'];
971
-                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($matches['broken']);
971
+                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper.\crc32($matches['broken']);
972 972
 
973
-                    return $matches['start'] . $matchesHash . $matches['end'];
973
+                    return $matches['start'].$matchesHash.$matches['end'];
974 974
                 },
975 975
                 $html
976 976
             );
@@ -992,14 +992,14 @@  discard block
 block discarded – undo
992 992
     {
993 993
         // regEx for e.g.: [<script id="elements-image-1" type="text/html">...</script>]
994 994
         $tags = \implode('|', \array_map(
995
-            static function ($value) {
995
+            static function($value) {
996 996
                 return \preg_quote($value, '/');
997 997
             },
998 998
             $this->specialScriptTags
999 999
         ));
1000 1000
         $html = (string) \preg_replace_callback(
1001
-            '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:' . $tags . ')+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU',
1002
-            function ($matches) {
1001
+            '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:'.$tags.')+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU',
1002
+            function($matches) {
1003 1003
 
1004 1004
                 // Check for logic in special script tags, like [<% _.each(tierPrices, function(item, key) { %>],
1005 1005
                 // because often this looks like non valid html in the template itself.
@@ -1009,18 +1009,18 @@  discard block
 block discarded – undo
1009 1009
                         $matches['innerContent'] = \str_replace('<\/', '</', $matches['innerContent']);
1010 1010
 
1011 1011
                         self::$domBrokenReplaceHelper['orig'][] = $matches['innerContent'];
1012
-                        self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '' . self::$domHtmlBrokenHtmlHelper . '' . \crc32($matches['innerContent']);
1012
+                        self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = ''.self::$domHtmlBrokenHtmlHelper.''.\crc32($matches['innerContent']);
1013 1013
 
1014
-                        return $matches['start'] . $matchesHash . $matches['end'];
1014
+                        return $matches['start'].$matchesHash.$matches['end'];
1015 1015
                     }
1016 1016
                 }
1017 1017
 
1018 1018
                 // remove the html5 fallback
1019 1019
                 $matches[0] = \str_replace('<\/', '</', $matches[0]);
1020 1020
 
1021
-                $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($matches[0], \strlen('<script'));
1021
+                $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($matches[0], \strlen('<script'));
1022 1022
 
1023
-                return \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>';
1023
+                return \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>';
1024 1024
             },
1025 1025
             $html
1026 1026
         );
Please login to merge, or discard this patch.