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