Completed
Push — master ( 313909...1dc45b )
by Lars
02:12
created
src/voku/helper/HtmlMin.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     $this->protectedChildNodes = array();
139 139
     $this->randomHash = md5(Bootup::get_random_bytes(16));
140 140
 
141
-    $this->protectedChildNodesHelper = 'html-min--saved-content-' . $this->randomHash;
142
-    $this->booleanAttributesHelper = 'html-min--delete-this-' . $this->randomHash;
141
+    $this->protectedChildNodesHelper = 'html-min--saved-content-'.$this->randomHash;
142
+    $this->booleanAttributesHelper = 'html-min--delete-this-'.$this->randomHash;
143 143
   }
144 144
 
145 145
   /**
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
    */
150 150
   public function minify($html)
151 151
   {
152
-    $html = (string)$html;
152
+    $html = (string) $html;
153 153
     if (!isset($html[0])) {
154 154
       return '';
155 155
     }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     // -------------------------------------------------------------------------
195 195
 
196 196
     $html = preg_replace_callback(
197
-        '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/',
197
+        '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/',
198 198
         array($this, 'restoreProtectedHtml'),
199 199
         $html
200 200
     );
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 
209 209
     $html = str_replace(
210 210
         array(
211
-            'html>' . "\n",
212
-            "\n" . '<html',
211
+            'html>'."\n",
212
+            "\n".'<html',
213 213
             '<!doctype',
214
-            '="' . $this->booleanAttributesHelper . '"',
215
-            '</' . $this->protectedChildNodesHelper . '>',
214
+            '="'.$this->booleanAttributesHelper.'"',
215
+            '</'.$this->protectedChildNodesHelper.'>',
216 216
         ),
217 217
         array(
218 218
             'html>',
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
     $html = preg_replace(
228 228
         array(
229
-            '/<(?:' . $this->protectedChildNodesHelper . ')(:? [^>]*)?>/',
229
+            '/<(?:'.$this->protectedChildNodesHelper.')(:? [^>]*)?>/',
230 230
         ),
231 231
         array(
232 232
             '',
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     if ($cacheSelfClosingTags === null) {
239 239
       $cacheSelfClosingTags = implode('|', self::$selfClosingTags);
240 240
     }
241
-    $html = preg_replace('#<\b(' . $cacheSelfClosingTags . ')([^>]+)><\/\b\1>#', '<\\1\\2/>', $html);
241
+    $html = preg_replace('#<\b('.$cacheSelfClosingTags.')([^>]+)><\/\b\1>#', '<\\1\\2/>', $html);
242 242
 
243 243
     // ------------------------------------
244 244
     // check if compression worked
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     }
268 268
 
269 269
     $attrs = array();
270
-    foreach ((array)$attributs as $attrName => $attrValue) {
270
+    foreach ((array) $attributs as $attrName => $attrValue) {
271 271
 
272 272
       if (isset(self::$booleanAttributes[$attrName])) {
273 273
         $attrs[$attrName] = $this->booleanAttributesHelper;
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
       if (!$class) {
526 526
         continue;
527 527
       }
528
-      $attrValue .= trim($class) . ' ';
528
+      $attrValue .= trim($class).' ';
529 529
     }
530 530
     $attrValue = trim($attrValue);
531 531
 
Please login to merge, or discard this patch.