Completed
Push — master ( eed633...d1f2b9 )
by Lars
01:46
created
src/voku/helper/HtmlDomParser.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments);
147 147
         }
148 148
 
149
-        throw new \BadMethodCallException('Method does not exist: ' . $name);
149
+        throw new \BadMethodCallException('Method does not exist: '.$name);
150 150
     }
151 151
 
152 152
     /**
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             ||
343 343
             $this->keepBrokenHtml
344 344
         ) {
345
-            $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>';
345
+            $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>';
346 346
         }
347 347
 
348 348
         $html = self::replaceToPreserveHtmlEntities($html);
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             /** @noinspection StringFragmentMisplacedInspection */
365 365
             if (\stripos('<?xml', $html) !== 0) {
366 366
                 $xmlHackUsed = true;
367
-                $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html;
367
+                $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html;
368 368
             }
369 369
 
370 370
             $this->document->loadHTML($html, $optionsXml);
@@ -897,11 +897,11 @@  discard block
 block discarded – undo
897 897
 
898 898
             $html = (string) \preg_replace_callback(
899 899
                 '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui',
900
-                static function ($matches) {
901
-                    return $matches['start'] .
902
-                           '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' .
903
-                           $matches['value'] .
904
-                           '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' .
900
+                static function($matches) {
901
+                    return $matches['start'].
902
+                           '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'.
903
+                           $matches['value'].
904
+                           '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'.
905 905
                            $matches['end'];
906 906
                 },
907 907
                 $html
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 
914 914
             $html = (string) \preg_replace_callback(
915 915
                 '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u',
916
-                static function ($matches) {
916
+                static function($matches) {
917 917
                     $matches['broken'] = \str_replace(
918 918
                         ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'],
919 919
                         ['</', '<', '>'],
@@ -921,9 +921,9 @@  discard block
 block discarded – undo
921 921
                     );
922 922
 
923 923
                     self::$domBrokenReplaceHelper['orig'][] = $matches['broken'];
924
-                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($matches['broken']);
924
+                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper.\crc32($matches['broken']);
925 925
 
926
-                    return $matches['start'] . $matchesHash . $matches['end'];
926
+                    return $matches['start'].$matchesHash.$matches['end'];
927 927
                 },
928 928
                 $html
929 929
             );
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
         // regEx for e.g.: [<script id="elements-image-1" type="text/html">...</script>]
947 947
         $html = (string) \preg_replace_callback(
948 948
             '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:text\/html|text\/x-custom-template)+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU',
949
-            function ($matches) {
949
+            function($matches) {
950 950
 
951 951
                 // Check for logic in special script tags, like [<% _.each(tierPrices, function(item, key) { %>],
952 952
                 // because often this looks like non valid html in the template itself.
@@ -956,18 +956,18 @@  discard block
 block discarded – undo
956 956
                         $matches['innerContent'] = \str_replace('<\/', '</', $matches['innerContent']);
957 957
 
958 958
                         self::$domBrokenReplaceHelper['orig'][] = $matches['innerContent'];
959
-                        self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '' . self::$domHtmlBrokenHtmlHelper . '' . \crc32($matches['innerContent']);
959
+                        self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = ''.self::$domHtmlBrokenHtmlHelper.''.\crc32($matches['innerContent']);
960 960
 
961
-                        return $matches['start'] . $matchesHash . $matches['end'];
961
+                        return $matches['start'].$matchesHash.$matches['end'];
962 962
                     }
963 963
                 }
964 964
 
965 965
                 // remove the html5 fallback
966 966
                 $matches[0] = \str_replace('<\/', '</', $matches[0]);
967 967
 
968
-                $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($matches[0], \strlen('<script'));
968
+                $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($matches[0], \strlen('<script'));
969 969
 
970
-                return \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>';
970
+                return \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>';
971 971
             },
972 972
             $html
973 973
         );
Please login to merge, or discard this patch.