@@ -202,7 +202,7 @@ |
||
202 | 202 | continue; |
203 | 203 | } |
204 | 204 | |
205 | - $attrValue .= \trim($class) . ' '; |
|
205 | + $attrValue .= \trim($class).' '; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | return \trim($attrValue); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $attr_val = $attribute->value; |
544 | 544 | } |
545 | 545 | |
546 | - $attr_str .= ($omit_quotes ? '' : $quoteTmp) . $attr_val . ($omit_quotes ? '' : $quoteTmp); |
|
546 | + $attr_str .= ($omit_quotes ? '' : $quoteTmp).$attr_val.($omit_quotes ? '' : $quoteTmp); |
|
547 | 547 | $attr_str .= ' '; |
548 | 548 | } |
549 | 549 | } |
@@ -840,21 +840,21 @@ discard block |
||
840 | 840 | $tmpTypePublic = 'PUBLIC'; |
841 | 841 | } |
842 | 842 | |
843 | - $html .= '<!DOCTYPE ' . $child->name . '' |
|
844 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
845 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
843 | + $html .= '<!DOCTYPE '.$child->name.'' |
|
844 | + . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '') |
|
845 | + . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '') |
|
846 | 846 | . '>'; |
847 | 847 | } |
848 | 848 | } elseif ($child instanceof \DOMElement) { |
849 | - $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child)); |
|
850 | - $html .= '>' . $this->domNodeToString($child); |
|
849 | + $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child)); |
|
850 | + $html .= '>'.$this->domNodeToString($child); |
|
851 | 851 | |
852 | 852 | if ( |
853 | 853 | !$this->doRemoveOmittedHtmlTags |
854 | 854 | || |
855 | 855 | !$this->domNodeClosingTagOptional($child) |
856 | 856 | ) { |
857 | - $html .= '</' . $child->tagName . '>'; |
|
857 | + $html .= '</'.$child->tagName.'>'; |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | if (!$this->doRemoveWhitespaceAroundTags) { |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | $html .= $child->wholeText; |
895 | 895 | } |
896 | 896 | } elseif ($child instanceof \DOMComment) { |
897 | - $html .= '<!--' . $child->textContent . '-->'; |
|
897 | + $html .= '<!--'.$child->textContent.'-->'; |
|
898 | 898 | } |
899 | 899 | } |
900 | 900 | |
@@ -1094,8 +1094,8 @@ discard block |
||
1094 | 1094 | if (\strpos($html, ' ') !== false) { |
1095 | 1095 | $html = (string) \preg_replace_callback( |
1096 | 1096 | '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#', |
1097 | - static function ($matches) { |
|
1098 | - return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; |
|
1097 | + static function($matches) { |
|
1098 | + return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>'; |
|
1099 | 1099 | }, |
1100 | 1100 | $html |
1101 | 1101 | ); |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | |
1116 | 1116 | if (\strpos($html, $this->protectedChildNodesHelper) !== false) { |
1117 | 1117 | $html = (string) \preg_replace_callback( |
1118 | - '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/', |
|
1118 | + '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/', |
|
1119 | 1119 | [$this, 'restoreProtectedHtml'], |
1120 | 1120 | $html |
1121 | 1121 | ); |
@@ -1135,14 +1135,14 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | $html = \str_replace( |
1137 | 1137 | [ |
1138 | - 'html>' . "\n", |
|
1139 | - "\n" . '<html', |
|
1140 | - 'html/>' . "\n", |
|
1141 | - "\n" . '</html', |
|
1142 | - 'head>' . "\n", |
|
1143 | - "\n" . '<head', |
|
1144 | - 'head/>' . "\n", |
|
1145 | - "\n" . '</head', |
|
1138 | + 'html>'."\n", |
|
1139 | + "\n".'<html', |
|
1140 | + 'html/>'."\n", |
|
1141 | + "\n".'</html', |
|
1142 | + 'head>'."\n", |
|
1143 | + "\n".'<head', |
|
1144 | + 'head/>'."\n", |
|
1145 | + "\n".'</head', |
|
1146 | 1146 | ], |
1147 | 1147 | [ |
1148 | 1148 | 'html>', |
@@ -1161,11 +1161,11 @@ discard block |
||
1161 | 1161 | $replace = []; |
1162 | 1162 | $replacement = []; |
1163 | 1163 | foreach (self::$selfClosingTags as $selfClosingTag) { |
1164 | - $replace[] = '<' . $selfClosingTag . '/>'; |
|
1165 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
1166 | - $replace[] = '<' . $selfClosingTag . ' />'; |
|
1167 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
1168 | - $replace[] = '></' . $selfClosingTag . '>'; |
|
1164 | + $replace[] = '<'.$selfClosingTag.'/>'; |
|
1165 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
1166 | + $replace[] = '<'.$selfClosingTag.' />'; |
|
1167 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
1168 | + $replace[] = '></'.$selfClosingTag.'>'; |
|
1169 | 1169 | $replacement[] = '>'; |
1170 | 1170 | } |
1171 | 1171 | $html = \str_replace( |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->parentNode()->innerHtml(); |
1357 | - $element->getNode()->parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
1357 | + $element->getNode()->parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
1358 | 1358 | |
1359 | 1359 | ++$this->protected_tags_counter; |
1360 | 1360 | } |
@@ -1387,7 +1387,7 @@ discard block |
||
1387 | 1387 | } |
1388 | 1388 | |
1389 | 1389 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->innerhtml; |
1390 | - $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
1390 | + $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
1391 | 1391 | |
1392 | 1392 | ++$this->protected_tags_counter; |
1393 | 1393 | } |
@@ -1404,11 +1404,11 @@ discard block |
||
1404 | 1404 | continue; |
1405 | 1405 | } |
1406 | 1406 | |
1407 | - $this->protectedChildNodes[$this->protected_tags_counter] = '<!--' . $text . '-->'; |
|
1407 | + $this->protectedChildNodes[$this->protected_tags_counter] = '<!--'.$text.'-->'; |
|
1408 | 1408 | |
1409 | 1409 | /* @var $node \DOMComment */ |
1410 | 1410 | $node = $element->getNode(); |
1411 | - $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'); |
|
1411 | + $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'); |
|
1412 | 1412 | /** @noinspection UnusedFunctionResultInspection */ |
1413 | 1413 | $element->getNode()->parentNode->replaceChild($child, $node); |
1414 | 1414 |