Completed
Push — master ( 5ae024...9cd326 )
by Lars
01:29
created
src/voku/helper/HtmlMin.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
                     $attr_val = $attribute->value;
697 697
                 }
698 698
 
699
-                $attr_str .= ($omit_quotes ? '' : '"') . $attr_val . ($omit_quotes ? '' : '"');
699
+                $attr_str .= ($omit_quotes ? '' : '"').$attr_val.($omit_quotes ? '' : '"');
700 700
                 $attr_str .= ' ';
701 701
             }
702 702
         }
@@ -957,21 +957,21 @@  discard block
 block discarded – undo
957 957
                         $tmpTypePublic = 'PUBLIC';
958 958
                     }
959 959
 
960
-                    $html .= '<!DOCTYPE ' . $child->name . ''
961
-                             . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '')
962
-                             . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '')
960
+                    $html .= '<!DOCTYPE '.$child->name.''
961
+                             . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '')
962
+                             . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '')
963 963
                              . '>';
964 964
                 }
965 965
             } elseif ($child instanceof \DOMElement) {
966
-                $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child));
967
-                $html .= '>' . $this->domNodeToString($child);
966
+                $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child));
967
+                $html .= '>'.$this->domNodeToString($child);
968 968
 
969 969
                 if (
970 970
                     !$this->doRemoveOmittedHtmlTags
971 971
                     ||
972 972
                     !$this->domNodeClosingTagOptional($child)
973 973
                 ) {
974
-                    $html .= '</' . $child->tagName . '>';
974
+                    $html .= '</'.$child->tagName.'>';
975 975
                 }
976 976
 
977 977
                 if (!$this->doRemoveWhitespaceAroundTags) {
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
                     $html .= $child->wholeText;
1011 1011
                 }
1012 1012
             } elseif ($child instanceof \DOMComment) {
1013
-                $html .= '<!--' . $child->textContent . '-->';
1013
+                $html .= '<!--'.$child->textContent.'-->';
1014 1014
             }
1015 1015
         }
1016 1016
 
@@ -1102,8 +1102,8 @@  discard block
 block discarded – undo
1102 1102
         // Remove extra white-space(s) between HTML attribute(s)
1103 1103
         $html = (string) \preg_replace_callback(
1104 1104
             '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#',
1105
-            function ($matches) {
1106
-                return '<' . $matches[1] . (string) \preg_replace('#([^\s=]+)(\=([\'"]?)(.*?)\3)?(\s+|$)#s', ' $1$2', $matches[2]) . $matches[3] . '>';
1105
+            function($matches) {
1106
+                return '<'.$matches[1].(string) \preg_replace('#([^\s=]+)(\=([\'"]?)(.*?)\3)?(\s+|$)#s', ' $1$2', $matches[2]).$matches[3].'>';
1107 1107
             },
1108 1108
             $html
1109 1109
         );
@@ -1118,7 +1118,7 @@  discard block
 block discarded – undo
1118 1118
         // -------------------------------------------------------------------------
1119 1119
 
1120 1120
         $html = (string) \preg_replace_callback(
1121
-            '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/',
1121
+            '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/',
1122 1122
             [$this, 'restoreProtectedHtml'],
1123 1123
             $html
1124 1124
         );
@@ -1137,14 +1137,14 @@  discard block
 block discarded – undo
1137 1137
 
1138 1138
         $html = \str_replace(
1139 1139
             [
1140
-                'html>' . "\n",
1141
-                "\n" . '<html',
1142
-                'html/>' . "\n",
1143
-                "\n" . '</html',
1144
-                'head>' . "\n",
1145
-                "\n" . '<head',
1146
-                'head/>' . "\n",
1147
-                "\n" . '</head',
1140
+                'html>'."\n",
1141
+                "\n".'<html',
1142
+                'html/>'."\n",
1143
+                "\n".'</html',
1144
+                'head>'."\n",
1145
+                "\n".'<head',
1146
+                'head/>'."\n",
1147
+                "\n".'</head',
1148 1148
             ],
1149 1149
             [
1150 1150
                 'html>',
@@ -1163,10 +1163,10 @@  discard block
 block discarded – undo
1163 1163
         $replace = [];
1164 1164
         $replacement = [];
1165 1165
         foreach (self::$selfClosingTags as $selfClosingTag) {
1166
-            $replace[] = '<' . $selfClosingTag . '/>';
1167
-            $replacement[] = '<' . $selfClosingTag . '>';
1168
-            $replace[] = '<' . $selfClosingTag . ' />';
1169
-            $replacement[] = '<' . $selfClosingTag . '>';
1166
+            $replace[] = '<'.$selfClosingTag.'/>';
1167
+            $replacement[] = '<'.$selfClosingTag.'>';
1168
+            $replace[] = '<'.$selfClosingTag.' />';
1169
+            $replacement[] = '<'.$selfClosingTag.'>';
1170 1170
         }
1171 1171
         $html = \str_replace(
1172 1172
             $replace,
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
             $html
1175 1175
         );
1176 1176
 
1177
-        $html = (string) \preg_replace('#<\b(' . $CACHE_SELF_CLOSING_TAGS . ')([^>]*+)><\/\b\1>#', '<\\1\\2>', $html);
1177
+        $html = (string) \preg_replace('#<\b('.$CACHE_SELF_CLOSING_TAGS.')([^>]*+)><\/\b\1>#', '<\\1\\2>', $html);
1178 1178
 
1179 1179
         // ------------------------------------
1180 1180
         // check if compression worked
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
             }
1282 1282
 
1283 1283
             $this->protectedChildNodes[$counter] = $element->text();
1284
-            $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>';
1284
+            $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>';
1285 1285
 
1286 1286
             ++$counter;
1287 1287
         }
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
             }
1293 1293
 
1294 1294
             $this->protectedChildNodes[$counter] = $element->parentNode()->innerHtml();
1295
-            $element->getNode()->parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>';
1295
+            $element->getNode()->parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>';
1296 1296
 
1297 1297
             ++$counter;
1298 1298
         }
@@ -1305,11 +1305,11 @@  discard block
 block discarded – undo
1305 1305
                 continue;
1306 1306
             }
1307 1307
 
1308
-            $this->protectedChildNodes[$counter] = '<!--' . $text . '-->';
1308
+            $this->protectedChildNodes[$counter] = '<!--'.$text.'-->';
1309 1309
 
1310 1310
             /* @var $node \DOMComment */
1311 1311
             $node = $element->getNode();
1312
-            $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>');
1312
+            $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>');
1313 1313
             /** @noinspection UnusedFunctionResultInspection */
1314 1314
             $element->getNode()->parentNode->replaceChild($child, $node);
1315 1315
 
Please login to merge, or discard this patch.