Completed
Pull Request — master (#47)
by Lars
01:20
created
src/voku/helper/HtmlMinDomObserverOptimizeAttributes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 $attrName === 'action'
265 265
             )
266 266
         ) {
267
-            $attrValue = \str_replace($scheme . '://', '//', $attrValue);
267
+            $attrValue = \str_replace($scheme.'://', '//', $attrValue);
268 268
         }
269 269
 
270 270
         return $attrValue;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                 continue;
294 294
             }
295 295
 
296
-            $attrValue .= \trim($class) . ' ';
296
+            $attrValue .= \trim($class).' ';
297 297
         }
298 298
 
299 299
         return \trim($attrValue);
Please login to merge, or discard this patch.
src/voku/helper/HtmlMin.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
                     $attr_val = $attribute->value;
638 638
                 }
639 639
 
640
-                $attr_str .= ($omit_quotes ? '' : $quoteTmp) . $attr_val . ($omit_quotes ? '' : $quoteTmp);
640
+                $attr_str .= ($omit_quotes ? '' : $quoteTmp).$attr_val.($omit_quotes ? '' : $quoteTmp);
641 641
                 $attr_str .= ' ';
642 642
             }
643 643
         }
@@ -935,8 +935,8 @@  discard block
 block discarded – undo
935 935
             }
936 936
 
937 937
             if ($child instanceof \DOMElement) {
938
-                $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child));
939
-                $html .= '>' . $this->domNodeToString($child);
938
+                $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child));
939
+                $html .= '>'.$this->domNodeToString($child);
940 940
 
941 941
                 if (
942 942
                     !(
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
                         $this->domNodeClosingTagOptional($child)
950 950
                     )
951 951
                 ) {
952
-                    $html .= '</' . $child->tagName . '>';
952
+                    $html .= '</'.$child->tagName.'>';
953 953
                 }
954 954
 
955 955
                 if (!$this->doRemoveWhitespaceAroundTags) {
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
                     $html .= $child->wholeText;
1014 1014
                 }
1015 1015
             } elseif ($child instanceof \DOMComment) {
1016
-                $html .= '<!--' . $child->textContent . '-->';
1016
+                $html .= '<!--'.$child->textContent.'-->';
1017 1017
             }
1018 1018
         }
1019 1019
 
@@ -1046,9 +1046,9 @@  discard block
 block discarded – undo
1046 1046
                     $tmpTypePublic = 'PUBLIC';
1047 1047
                 }
1048 1048
 
1049
-                return '<!DOCTYPE ' . $child->name . ''
1050
-                       . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '')
1051
-                       . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '')
1049
+                return '<!DOCTYPE '.$child->name.''
1050
+                       . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '')
1051
+                       . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '')
1052 1052
                        . '>';
1053 1053
             }
1054 1054
         }
@@ -1289,8 +1289,8 @@  discard block
 block discarded – undo
1289 1289
         if (\strpos($html, ' ') !== false) {
1290 1290
             $html = (string) \preg_replace_callback(
1291 1291
                 '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#',
1292
-                static function ($matches) {
1293
-                    return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>';
1292
+                static function($matches) {
1293
+                    return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>';
1294 1294
                 },
1295 1295
                 $html
1296 1296
             );
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 
1311 1311
         if (\strpos($html, $this->protectedChildNodesHelper) !== false) {
1312 1312
             $html = (string) \preg_replace_callback(
1313
-                '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/',
1313
+                '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/',
1314 1314
                 [$this, 'restoreProtectedHtml'],
1315 1315
                 $html
1316 1316
             );
@@ -1330,14 +1330,14 @@  discard block
 block discarded – undo
1330 1330
 
1331 1331
         $html = \str_replace(
1332 1332
             [
1333
-                'html>' . "\n",
1334
-                "\n" . '<html',
1335
-                'html/>' . "\n",
1336
-                "\n" . '</html',
1337
-                'head>' . "\n",
1338
-                "\n" . '<head',
1339
-                'head/>' . "\n",
1340
-                "\n" . '</head',
1333
+                'html>'."\n",
1334
+                "\n".'<html',
1335
+                'html/>'."\n",
1336
+                "\n".'</html',
1337
+                'head>'."\n",
1338
+                "\n".'<head',
1339
+                'head/>'."\n",
1340
+                "\n".'</head',
1341 1341
             ],
1342 1342
             [
1343 1343
                 'html>',
@@ -1356,11 +1356,11 @@  discard block
 block discarded – undo
1356 1356
         $replace = [];
1357 1357
         $replacement = [];
1358 1358
         foreach (self::$selfClosingTags as $selfClosingTag) {
1359
-            $replace[] = '<' . $selfClosingTag . '/>';
1360
-            $replacement[] = '<' . $selfClosingTag . '>';
1361
-            $replace[] = '<' . $selfClosingTag . ' />';
1362
-            $replacement[] = '<' . $selfClosingTag . '>';
1363
-            $replace[] = '></' . $selfClosingTag . '>';
1359
+            $replace[] = '<'.$selfClosingTag.'/>';
1360
+            $replacement[] = '<'.$selfClosingTag.'>';
1361
+            $replace[] = '<'.$selfClosingTag.' />';
1362
+            $replacement[] = '<'.$selfClosingTag.'>';
1363
+            $replace[] = '></'.$selfClosingTag.'>';
1364 1364
             $replacement[] = '>';
1365 1365
         }
1366 1366
         $html = \str_replace(
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
         // -------------------------------------------------------------------------
1516 1516
 
1517 1517
         return $dom->fixHtmlOutput(
1518
-            $doctypeStr . $this->domNodeToString($dom->getDocument()),
1518
+            $doctypeStr.$this->domNodeToString($dom->getDocument()),
1519 1519
             $multiDecodeNewHtmlEntity
1520 1520
         );
1521 1521
     }
@@ -1560,7 +1560,7 @@  discard block
 block discarded – undo
1560 1560
             $this->protectedChildNodes[$this->protected_tags_counter] = $element->parentNode()->innerHtml();
1561 1561
             $parentNode = $element->getNode()->parentNode;
1562 1562
             if ($parentNode !== null) {
1563
-                $parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>';
1563
+                $parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>';
1564 1564
             }
1565 1565
 
1566 1566
             ++$this->protected_tags_counter;
@@ -1594,7 +1594,7 @@  discard block
 block discarded – undo
1594 1594
             }
1595 1595
 
1596 1596
             $this->protectedChildNodes[$this->protected_tags_counter] = $element->innerhtml;
1597
-            $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>';
1597
+            $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>';
1598 1598
 
1599 1599
             ++$this->protected_tags_counter;
1600 1600
         }
@@ -1611,11 +1611,11 @@  discard block
 block discarded – undo
1611 1611
                 continue;
1612 1612
             }
1613 1613
 
1614
-            $this->protectedChildNodes[$this->protected_tags_counter] = '<!--' . $text . '-->';
1614
+            $this->protectedChildNodes[$this->protected_tags_counter] = '<!--'.$text.'-->';
1615 1615
 
1616 1616
             /* @var $node \DOMComment */
1617 1617
             $node = $element->getNode();
1618
-            $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>');
1618
+            $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>');
1619 1619
             $parentNode = $element->getNode()->parentNode;
1620 1620
             if ($parentNode !== null) {
1621 1621
                 $parentNode->replaceChild($child, $node);
Please login to merge, or discard this patch.