Completed
Push — master ( 3ca20d...affb1c )
by Lars
01:27
created
src/voku/helper/HtmlMinDomObserverOptimizeAttributes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
                 continue;
203 203
             }
204 204
 
205
-            $attrValue .= \trim($class) . ' ';
205
+            $attrValue .= \trim($class).' ';
206 206
         }
207 207
 
208 208
         return \trim($attrValue);
Please login to merge, or discard this patch.
src/voku/helper/HtmlMin.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
                     $attr_val = $attribute->value;
715 715
                 }
716 716
 
717
-                $attr_str .= ($omit_quotes ? '' : $quoteTmp) . $attr_val . ($omit_quotes ? '' : $quoteTmp);
717
+                $attr_str .= ($omit_quotes ? '' : $quoteTmp).$attr_val.($omit_quotes ? '' : $quoteTmp);
718 718
                 $attr_str .= ' ';
719 719
             }
720 720
         }
@@ -979,21 +979,21 @@  discard block
 block discarded – undo
979 979
                         $tmpTypePublic = 'PUBLIC';
980 980
                     }
981 981
 
982
-                    $html .= '<!DOCTYPE ' . $child->name . ''
983
-                             . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '')
984
-                             . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '')
982
+                    $html .= '<!DOCTYPE '.$child->name.''
983
+                             . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '')
984
+                             . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '')
985 985
                              . '>';
986 986
                 }
987 987
             } elseif ($child instanceof \DOMElement) {
988
-                $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child));
989
-                $html .= '>' . $this->domNodeToString($child);
988
+                $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child));
989
+                $html .= '>'.$this->domNodeToString($child);
990 990
 
991 991
                 if (
992 992
                     !$this->doRemoveOmittedHtmlTags
993 993
                     ||
994 994
                     !$this->domNodeClosingTagOptional($child)
995 995
                 ) {
996
-                    $html .= '</' . $child->tagName . '>';
996
+                    $html .= '</'.$child->tagName.'>';
997 997
                 }
998 998
 
999 999
                 if (!$this->doRemoveWhitespaceAroundTags) {
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
                     $html .= $child->wholeText;
1034 1034
                 }
1035 1035
             } elseif ($child instanceof \DOMComment) {
1036
-                $html .= '<!--' . $child->textContent . '-->';
1036
+                $html .= '<!--'.$child->textContent.'-->';
1037 1037
             }
1038 1038
         }
1039 1039
 
@@ -1125,8 +1125,8 @@  discard block
 block discarded – undo
1125 1125
         // Remove extra white-space(s) between HTML attribute(s)
1126 1126
         $html = (string) \preg_replace_callback(
1127 1127
             '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#',
1128
-            static function ($matches) {
1129
-                return '<' . $matches[1] . \preg_replace('#([^\s=]+)(\=([\'"]?)(.*?)\3)?(\s+|$)#s', ' $1$2', $matches[2]) . $matches[3] . '>';
1128
+            static function($matches) {
1129
+                return '<'.$matches[1].\preg_replace('#([^\s=]+)(\=([\'"]?)(.*?)\3)?(\s+|$)#s', ' $1$2', $matches[2]).$matches[3].'>';
1130 1130
             },
1131 1131
             $html
1132 1132
         );
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         // -------------------------------------------------------------------------
1142 1142
 
1143 1143
         $html = (string) \preg_replace_callback(
1144
-            '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/',
1144
+            '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/',
1145 1145
             [$this, 'restoreProtectedHtml'],
1146 1146
             $html
1147 1147
         );
@@ -1160,14 +1160,14 @@  discard block
 block discarded – undo
1160 1160
 
1161 1161
         $html = \str_replace(
1162 1162
             [
1163
-                'html>' . "\n",
1164
-                "\n" . '<html',
1165
-                'html/>' . "\n",
1166
-                "\n" . '</html',
1167
-                'head>' . "\n",
1168
-                "\n" . '<head',
1169
-                'head/>' . "\n",
1170
-                "\n" . '</head',
1163
+                'html>'."\n",
1164
+                "\n".'<html',
1165
+                'html/>'."\n",
1166
+                "\n".'</html',
1167
+                'head>'."\n",
1168
+                "\n".'<head',
1169
+                'head/>'."\n",
1170
+                "\n".'</head',
1171 1171
             ],
1172 1172
             [
1173 1173
                 'html>',
@@ -1186,10 +1186,10 @@  discard block
 block discarded – undo
1186 1186
         $replace = [];
1187 1187
         $replacement = [];
1188 1188
         foreach (self::$selfClosingTags as $selfClosingTag) {
1189
-            $replace[] = '<' . $selfClosingTag . '/>';
1190
-            $replacement[] = '<' . $selfClosingTag . '>';
1191
-            $replace[] = '<' . $selfClosingTag . ' />';
1192
-            $replacement[] = '<' . $selfClosingTag . '>';
1189
+            $replace[] = '<'.$selfClosingTag.'/>';
1190
+            $replacement[] = '<'.$selfClosingTag.'>';
1191
+            $replace[] = '<'.$selfClosingTag.' />';
1192
+            $replacement[] = '<'.$selfClosingTag.'>';
1193 1193
         }
1194 1194
         $html = \str_replace(
1195 1195
             $replace,
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
             $html
1198 1198
         );
1199 1199
 
1200
-        $html = (string) \preg_replace('#<\b(' . $CACHE_SELF_CLOSING_TAGS . ')([^>]*+)><\/\b\1>#', '<\\1\\2>', $html);
1200
+        $html = (string) \preg_replace('#<\b('.$CACHE_SELF_CLOSING_TAGS.')([^>]*+)><\/\b\1>#', '<\\1\\2>', $html);
1201 1201
 
1202 1202
         // ------------------------------------
1203 1203
         // check if compression worked
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
             }
1305 1305
 
1306 1306
             $this->protectedChildNodes[$counter] = $element->innerhtml;
1307
-            $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>';
1307
+            $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>';
1308 1308
 
1309 1309
             ++$counter;
1310 1310
         }
@@ -1315,7 +1315,7 @@  discard block
 block discarded – undo
1315 1315
             }
1316 1316
 
1317 1317
             $this->protectedChildNodes[$counter] = $element->parentNode()->innerHtml();
1318
-            $element->getNode()->parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>';
1318
+            $element->getNode()->parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>';
1319 1319
 
1320 1320
             ++$counter;
1321 1321
         }
@@ -1328,11 +1328,11 @@  discard block
 block discarded – undo
1328 1328
                 continue;
1329 1329
             }
1330 1330
 
1331
-            $this->protectedChildNodes[$counter] = '<!--' . $text . '-->';
1331
+            $this->protectedChildNodes[$counter] = '<!--'.$text.'-->';
1332 1332
 
1333 1333
             /* @var $node \DOMComment */
1334 1334
             $node = $element->getNode();
1335
-            $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>');
1335
+            $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>');
1336 1336
             /** @noinspection UnusedFunctionResultInspection */
1337 1337
             $element->getNode()->parentNode->replaceChild($child, $node);
1338 1338
 
Please login to merge, or discard this patch.