@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function minify($html) |
247 | 247 | { |
248 | - $html = (string)$html; |
|
248 | + $html = (string) $html; |
|
249 | 249 | if (!isset($html[0])) { |
250 | 250 | return ''; |
251 | 251 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | // ------------------------------------------------------------------------- |
340 | 340 | |
341 | 341 | $html = preg_replace_callback( |
342 | - '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/', |
|
342 | + '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/', |
|
343 | 343 | array($this, 'restoreProtectedHtml'), |
344 | 344 | $html |
345 | 345 | ); |
@@ -353,15 +353,15 @@ discard block |
||
353 | 353 | |
354 | 354 | $html = str_replace( |
355 | 355 | array( |
356 | - 'html>' . "\n", |
|
357 | - "\n" . '<html', |
|
358 | - 'html/>' . "\n", |
|
359 | - "\n" . '</html', |
|
360 | - 'head>' . "\n", |
|
361 | - "\n" . '<head', |
|
362 | - 'head/>' . "\n", |
|
363 | - "\n" . '</head', |
|
364 | - '="' . $this->booleanAttributesHelper . '"', |
|
356 | + 'html>'."\n", |
|
357 | + "\n".'<html', |
|
358 | + 'html/>'."\n", |
|
359 | + "\n".'</html', |
|
360 | + 'head>'."\n", |
|
361 | + "\n".'<head', |
|
362 | + 'head/>'."\n", |
|
363 | + "\n".'</head', |
|
364 | + '="'.$this->booleanAttributesHelper.'"', |
|
365 | 365 | ), |
366 | 366 | array( |
367 | 367 | 'html>', |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | $html |
378 | 378 | ); |
379 | 379 | |
380 | - $html = preg_replace('#<\b(' . $cacheSelfClosingTags . ')([^>]+)><\/\b\1>#', '<\\1\\2/>', $html); |
|
380 | + $html = preg_replace('#<\b('.$cacheSelfClosingTags.')([^>]+)><\/\b\1>#', '<\\1\\2/>', $html); |
|
381 | 381 | |
382 | 382 | // ------------------------------------ |
383 | 383 | // check if compression worked |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | } |
406 | 406 | |
407 | 407 | $attrs = array(); |
408 | - foreach ((array)$attributes as $attrName => $attrValue) { |
|
408 | + foreach ((array) $attributes as $attrName => $attrValue) { |
|
409 | 409 | |
410 | 410 | if (isset(self::$booleanAttributes[$attrName])) { |
411 | 411 | |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | } |
491 | 491 | |
492 | 492 | $this->protectedChildNodes[$counter] = $element->text(); |
493 | - $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
493 | + $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
494 | 494 | |
495 | 495 | ++$counter; |
496 | 496 | } |
@@ -505,11 +505,11 @@ discard block |
||
505 | 505 | continue; |
506 | 506 | } |
507 | 507 | |
508 | - $this->protectedChildNodes[$counter] = '<!--' . $text . '-->'; |
|
508 | + $this->protectedChildNodes[$counter] = '<!--'.$text.'-->'; |
|
509 | 509 | |
510 | 510 | /* @var $node \DOMComment */ |
511 | 511 | $node = $element->getNode(); |
512 | - $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $counter . '"></' . $this->protectedChildNodesHelper . '>'); |
|
512 | + $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$counter.'"></'.$this->protectedChildNodesHelper.'>'); |
|
513 | 513 | $element->getNode()->parentNode->replaceChild($child, $node); |
514 | 514 | |
515 | 515 | ++$counter; |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | continue; |
807 | 807 | } |
808 | 808 | |
809 | - $attrValue .= trim($class) . ' '; |
|
809 | + $attrValue .= trim($class).' '; |
|
810 | 810 | } |
811 | 811 | $attrValue = trim($attrValue); |
812 | 812 |