Completed
Push — master ( 899793...d65cdf )
by Lars
02:01 queued 17s
created
src/voku/helper/HtmlDomParser.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments);
122 122
         }
123 123
 
124
-        throw new \BadMethodCallException('Method does not exist: ' . $name);
124
+        throw new \BadMethodCallException('Method does not exist: '.$name);
125 125
     }
126 126
 
127 127
     /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             ||
286 286
             $this->keepBrokenHtml
287 287
         ) {
288
-            $html = '<' . self::$domHtmlWrapperHelper . '>' . $html . '</' . self::$domHtmlWrapperHelper . '>';
288
+            $html = '<'.self::$domHtmlWrapperHelper.'>'.$html.'</'.self::$domHtmlWrapperHelper.'>';
289 289
         }
290 290
 
291 291
         $html = self::replaceToPreserveHtmlEntities($html);
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             /** @noinspection StringFragmentMisplacedInspection */
308 308
             if (\stripos('<?xml', $html) !== 0) {
309 309
                 $xmlHackUsed = true;
310
-                $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html;
310
+                $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html;
311 311
             }
312 312
 
313 313
             $this->document->loadHTML($html, $optionsXml);
@@ -788,11 +788,11 @@  discard block
 block discarded – undo
788 788
 
789 789
             $html = (string) \preg_replace_callback(
790 790
                 '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui',
791
-                static function ($matches) {
792
-                    return $matches['start'] .
793
-                           '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' .
794
-                           $matches['value'] .
795
-                           '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' .
791
+                static function($matches) {
792
+                    return $matches['start'].
793
+                           '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'.
794
+                           $matches['value'].
795
+                           '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'.
796 796
                            $matches['end'];
797 797
                 },
798 798
                 $html
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 
805 805
             $html = (string) \preg_replace_callback(
806 806
                 '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u',
807
-                static function ($matches) {
807
+                static function($matches) {
808 808
                     $matches['broken'] = \str_replace(
809 809
                         ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'],
810 810
                         ['</', '<', '>'],
@@ -812,9 +812,9 @@  discard block
 block discarded – undo
812 812
                     );
813 813
 
814 814
                     self::$domBrokenReplaceHelper['orig'][] = $matches['broken'];
815
-                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper . \crc32($matches['broken']);
815
+                    self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = self::$domHtmlBrokenHtmlHelper.\crc32($matches['broken']);
816 816
 
817
-                    return $matches['start'] . $matchesHash . $matches['end'];
817
+                    return $matches['start'].$matchesHash.$matches['end'];
818 818
                 },
819 819
                 $html
820 820
             );
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
         // regEx for e.g.: [<script id="elements-image-1" type="text/html">...</script>]
836 836
         $html = (string) \preg_replace_callback(
837 837
             '/(?<start>((?:<script) [^>]*type=(?:["\'])?(?:text\/html|text\/x-custom-template)+(?:[^>]*)>))(?<innerContent>.*)(?<end><\/script>)/isU',
838
-            static function ($matches) {
838
+            static function($matches) {
839 839
 
840 840
                 if (
841 841
                     strpos($matches['innerContent'], '+') === false
@@ -849,8 +849,8 @@  discard block
 block discarded – undo
849 849
                     // remove the html5 fallback
850 850
                     $matches[0] = \str_replace('<\/', '</', $matches[0]);
851 851
 
852
-                    $specialNonScript = '<' . self::$domHtmlSpecialScriptHelper . \substr($matches[0], \strlen('<script'));
853
-                    $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')) . '</' . self::$domHtmlSpecialScriptHelper . '>';
852
+                    $specialNonScript = '<'.self::$domHtmlSpecialScriptHelper.\substr($matches[0], \strlen('<script'));
853
+                    $specialNonScript = \substr($specialNonScript, 0, -\strlen('</script>')).'</'.self::$domHtmlSpecialScriptHelper.'>';
854 854
 
855 855
                     return $specialNonScript;
856 856
                 }
@@ -859,9 +859,9 @@  discard block
 block discarded – undo
859 859
                 $matches['innerContent'] = \str_replace('<\/', '</', $matches['innerContent']);
860 860
 
861 861
                 self::$domBrokenReplaceHelper['orig'][] = $matches['innerContent'];
862
-                self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '' . self::$domHtmlBrokenHtmlHelper . '' . \crc32($matches['innerContent']);
862
+                self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = ''.self::$domHtmlBrokenHtmlHelper.''.\crc32($matches['innerContent']);
863 863
 
864
-                return $matches['start'] . $matchesHash . $matches['end'];
864
+                return $matches['start'].$matchesHash.$matches['end'];
865 865
             },
866 866
             $html
867 867
         );
Please login to merge, or discard this patch.