@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $this->protectedChildNodes = array(); |
| 114 | 114 | $this->randomHash = md5(Bootup::get_random_bytes(16)); |
| 115 | 115 | |
| 116 | - $this->protectedChildNodesHelper = 'html-min--saved-content-' . $this->randomHash; |
|
| 117 | - $this->booleanAttributesHelper = 'html-min--delete-this-' . $this->randomHash; |
|
| 116 | + $this->protectedChildNodesHelper = 'html-min--saved-content-'.$this->randomHash; |
|
| 117 | + $this->booleanAttributesHelper = 'html-min--delete-this-'.$this->randomHash; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | public function minify($html) |
| 126 | 126 | { |
| 127 | - $html = (string)$html; |
|
| 127 | + $html = (string) $html; |
|
| 128 | 128 | if (!isset($html[0])) { |
| 129 | 129 | return ''; |
| 130 | 130 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | // ------------------------------------------------------------------------- |
| 170 | 170 | |
| 171 | 171 | $html = preg_replace_callback( |
| 172 | - '/<(?<element>'. $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/', |
|
| 172 | + '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/', |
|
| 173 | 173 | array($this, 'restoreProtectedHtml'), |
| 174 | 174 | $html |
| 175 | 175 | ); |
@@ -183,11 +183,11 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $html = str_replace( |
| 185 | 185 | array( |
| 186 | - 'html>' . "\n", |
|
| 187 | - "\n" . '<html', |
|
| 186 | + 'html>'."\n", |
|
| 187 | + "\n".'<html', |
|
| 188 | 188 | '<!doctype', |
| 189 | - '="' . $this->booleanAttributesHelper . '"', |
|
| 190 | - '</' . $this->protectedChildNodesHelper . '>', |
|
| 189 | + '="'.$this->booleanAttributesHelper.'"', |
|
| 190 | + '</'.$this->protectedChildNodesHelper.'>', |
|
| 191 | 191 | ), |
| 192 | 192 | array( |
| 193 | 193 | 'html>', |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $html = preg_replace( |
| 203 | 203 | array( |
| 204 | - '/<(?:' . $this->protectedChildNodesHelper . ')(:? [^>]*)?>/' |
|
| 204 | + '/<(?:'.$this->protectedChildNodesHelper.')(:? [^>]*)?>/' |
|
| 205 | 205 | ), |
| 206 | 206 | array( |
| 207 | 207 | '' |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | if (!$class) { |
| 533 | 533 | continue; |
| 534 | 534 | } |
| 535 | - $attrValue .= trim($class) . ' '; |
|
| 535 | + $attrValue .= trim($class).' '; |
|
| 536 | 536 | } |
| 537 | 537 | $attrValue = trim($attrValue); |
| 538 | 538 | |