Completed
Push — master ( 2a7a8f...d27882 )
by Lars
01:25
created
src/voku/helper/HtmlMin.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
                     $attr_val = $attribute->value;
573 573
                 }
574 574
 
575
-                $attr_str .= ($omit_quotes ? '' : $quoteTmp) . $attr_val . ($omit_quotes ? '' : $quoteTmp);
575
+                $attr_str .= ($omit_quotes ? '' : $quoteTmp).$attr_val.($omit_quotes ? '' : $quoteTmp);
576 576
                 $attr_str .= ' ';
577 577
             }
578 578
         }
@@ -869,21 +869,21 @@  discard block
 block discarded – undo
869 869
                         $tmpTypePublic = 'PUBLIC';
870 870
                     }
871 871
 
872
-                    $html .= '<!DOCTYPE ' . $child->name . ''
873
-                             . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '')
874
-                             . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '')
872
+                    $html .= '<!DOCTYPE '.$child->name.''
873
+                             . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '')
874
+                             . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '')
875 875
                              . '>';
876 876
                 }
877 877
             } elseif ($child instanceof \DOMElement) {
878
-                $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child));
879
-                $html .= '>' . $this->domNodeToString($child);
878
+                $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child));
879
+                $html .= '>'.$this->domNodeToString($child);
880 880
 
881 881
                 if (
882 882
                     !$this->doRemoveOmittedHtmlTags
883 883
                     ||
884 884
                     !$this->domNodeClosingTagOptional($child)
885 885
                 ) {
886
-                    $html .= '</' . $child->tagName . '>';
886
+                    $html .= '</'.$child->tagName.'>';
887 887
                 }
888 888
 
889 889
                 if (!$this->doRemoveWhitespaceAroundTags) {
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
                     $html .= $child->wholeText;
948 948
                 }
949 949
             } elseif ($child instanceof \DOMComment) {
950
-                $html .= '<!--' . $child->textContent . '-->';
950
+                $html .= '<!--'.$child->textContent.'-->';
951 951
             }
952 952
         }
953 953
 
@@ -1155,8 +1155,8 @@  discard block
 block discarded – undo
1155 1155
         if (\strpos($html, ' ') !== false) {
1156 1156
             $html = (string) \preg_replace_callback(
1157 1157
                 '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#',
1158
-                static function ($matches) {
1159
-                    return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>';
1158
+                static function($matches) {
1159
+                    return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>';
1160 1160
                 },
1161 1161
                 $html
1162 1162
             );
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
         if (\strpos($html, $this->protectedChildNodesHelper) !== false) {
1178 1178
             $html = (string) \preg_replace_callback(
1179
-                '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/',
1179
+                '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/',
1180 1180
                 [$this, 'restoreProtectedHtml'],
1181 1181
                 $html
1182 1182
             );
@@ -1196,14 +1196,14 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
         $html = \str_replace(
1198 1198
             [
1199
-                'html>' . "\n",
1200
-                "\n" . '<html',
1201
-                'html/>' . "\n",
1202
-                "\n" . '</html',
1203
-                'head>' . "\n",
1204
-                "\n" . '<head',
1205
-                'head/>' . "\n",
1206
-                "\n" . '</head',
1199
+                'html>'."\n",
1200
+                "\n".'<html',
1201
+                'html/>'."\n",
1202
+                "\n".'</html',
1203
+                'head>'."\n",
1204
+                "\n".'<head',
1205
+                'head/>'."\n",
1206
+                "\n".'</head',
1207 1207
             ],
1208 1208
             [
1209 1209
                 'html>',
@@ -1222,11 +1222,11 @@  discard block
 block discarded – undo
1222 1222
         $replace = [];
1223 1223
         $replacement = [];
1224 1224
         foreach (self::$selfClosingTags as $selfClosingTag) {
1225
-            $replace[] = '<' . $selfClosingTag . '/>';
1226
-            $replacement[] = '<' . $selfClosingTag . '>';
1227
-            $replace[] = '<' . $selfClosingTag . ' />';
1228
-            $replacement[] = '<' . $selfClosingTag . '>';
1229
-            $replace[] = '></' . $selfClosingTag . '>';
1225
+            $replace[] = '<'.$selfClosingTag.'/>';
1226
+            $replacement[] = '<'.$selfClosingTag.'>';
1227
+            $replace[] = '<'.$selfClosingTag.' />';
1228
+            $replacement[] = '<'.$selfClosingTag.'>';
1229
+            $replace[] = '></'.$selfClosingTag.'>';
1230 1230
             $replacement[] = '>';
1231 1231
         }
1232 1232
         $html = \str_replace(
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
             $this->protectedChildNodes[$this->protected_tags_counter] = $element->parentNode()->innerHtml();
1418 1418
             $parentNode = $element->getNode()->parentNode;
1419 1419
             if ($parentNode !== null) {
1420
-                $parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>';
1420
+                $parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>';
1421 1421
             }
1422 1422
 
1423 1423
             ++$this->protected_tags_counter;
@@ -1451,7 +1451,7 @@  discard block
 block discarded – undo
1451 1451
             }
1452 1452
 
1453 1453
             $this->protectedChildNodes[$this->protected_tags_counter] = $element->innerhtml;
1454
-            $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>';
1454
+            $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>';
1455 1455
 
1456 1456
             ++$this->protected_tags_counter;
1457 1457
         }
@@ -1468,11 +1468,11 @@  discard block
 block discarded – undo
1468 1468
                 continue;
1469 1469
             }
1470 1470
 
1471
-            $this->protectedChildNodes[$this->protected_tags_counter] = '<!--' . $text . '-->';
1471
+            $this->protectedChildNodes[$this->protected_tags_counter] = '<!--'.$text.'-->';
1472 1472
 
1473 1473
             /* @var $node \DOMComment */
1474 1474
             $node = $element->getNode();
1475
-            $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>');
1475
+            $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>');
1476 1476
             $parentNode = $element->getNode()->parentNode;
1477 1477
             if ($parentNode !== null) {
1478 1478
                 $parentNode->replaceChild($child, $node);
Please login to merge, or discard this patch.
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.