@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $attrName === 'action' |
| 265 | 265 | ) |
| 266 | 266 | ) { |
| 267 | - $attrValue = \str_replace($scheme . '://', '//', $attrValue); |
|
| 267 | + $attrValue = \str_replace($scheme.'://', '//', $attrValue); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | return $attrValue; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | continue; |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - $attrValue .= \trim($class) . ' '; |
|
| 296 | + $attrValue .= \trim($class).' '; |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | return \trim($attrValue); |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | $attr_val = $attribute->value; |
| 704 | 704 | } |
| 705 | 705 | |
| 706 | - $attr_str .= ($omit_quotes ? '' : $quoteTmp) . $attr_val . ($omit_quotes ? '' : $quoteTmp); |
|
| 706 | + $attr_str .= ($omit_quotes ? '' : $quoteTmp).$attr_val.($omit_quotes ? '' : $quoteTmp); |
|
| 707 | 707 | $attr_str .= ' '; |
| 708 | 708 | } |
| 709 | 709 | } |
@@ -995,8 +995,8 @@ discard block |
||
| 995 | 995 | } |
| 996 | 996 | |
| 997 | 997 | if ($child instanceof \DOMElement) { |
| 998 | - $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child)); |
|
| 999 | - $html .= '>' . $this->domNodeToString($child); |
|
| 998 | + $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child)); |
|
| 999 | + $html .= '>'.$this->domNodeToString($child); |
|
| 1000 | 1000 | |
| 1001 | 1001 | if ( |
| 1002 | 1002 | !( |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | $this->domNodeClosingTagOptional($child) |
| 1010 | 1010 | ) |
| 1011 | 1011 | ) { |
| 1012 | - $html .= '</' . $child->tagName . '>'; |
|
| 1012 | + $html .= '</'.$child->tagName.'>'; |
|
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | if (!$this->doRemoveWhitespaceAroundTags) { |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | $html .= $child->wholeText; |
| 1075 | 1075 | } |
| 1076 | 1076 | } elseif ($child instanceof \DOMComment) { |
| 1077 | - $html .= '<!--' . $child->textContent . '-->'; |
|
| 1077 | + $html .= '<!--'.$child->textContent.'-->'; |
|
| 1078 | 1078 | } |
| 1079 | 1079 | } |
| 1080 | 1080 | |
@@ -1107,9 +1107,9 @@ discard block |
||
| 1107 | 1107 | $tmpTypePublic = 'PUBLIC'; |
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | - return '<!DOCTYPE ' . $child->name . '' |
|
| 1111 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
| 1112 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
| 1110 | + return '<!DOCTYPE '.$child->name.'' |
|
| 1111 | + . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '') |
|
| 1112 | + . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '') |
|
| 1113 | 1113 | . '>'; |
| 1114 | 1114 | } |
| 1115 | 1115 | } |
@@ -1374,18 +1374,18 @@ discard block |
||
| 1374 | 1374 | if (\strpos($html, ' ') !== false) { |
| 1375 | 1375 | $htmlCleaned = \preg_replace_callback( |
| 1376 | 1376 | '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#', |
| 1377 | - static function ($matches) { |
|
| 1378 | - return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; |
|
| 1377 | + static function($matches) { |
|
| 1378 | + return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>'; |
|
| 1379 | 1379 | }, |
| 1380 | 1380 | $html |
| 1381 | 1381 | ); |
| 1382 | 1382 | if ($htmlCleaned !== null) { |
| 1383 | - $html = (string)$htmlCleaned; |
|
| 1383 | + $html = (string) $htmlCleaned; |
|
| 1384 | 1384 | } else { |
| 1385 | 1385 | $htmlCleaned = (string) \preg_replace_callback( |
| 1386 | 1386 | '#<([^/\s<>!]+)(?:\s+([^<>]*)\s*|\s*)(/?)>#', |
| 1387 | - static function ($matches) { |
|
| 1388 | - return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; |
|
| 1387 | + static function($matches) { |
|
| 1388 | + return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>'; |
|
| 1389 | 1389 | }, |
| 1390 | 1390 | $html |
| 1391 | 1391 | ); |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | |
| 1408 | 1408 | if (\strpos($html, $this->protectedChildNodesHelper) !== false) { |
| 1409 | 1409 | $html = (string) \preg_replace_callback( |
| 1410 | - '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/', |
|
| 1410 | + '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/', |
|
| 1411 | 1411 | [$this, 'restoreProtectedHtml'], |
| 1412 | 1412 | $html |
| 1413 | 1413 | ); |
@@ -1427,14 +1427,14 @@ discard block |
||
| 1427 | 1427 | |
| 1428 | 1428 | $html = \str_replace( |
| 1429 | 1429 | [ |
| 1430 | - 'html>' . "\n", |
|
| 1431 | - "\n" . '<html', |
|
| 1432 | - 'html/>' . "\n", |
|
| 1433 | - "\n" . '</html', |
|
| 1434 | - 'head>' . "\n", |
|
| 1435 | - "\n" . '<head', |
|
| 1436 | - 'head/>' . "\n", |
|
| 1437 | - "\n" . '</head', |
|
| 1430 | + 'html>'."\n", |
|
| 1431 | + "\n".'<html', |
|
| 1432 | + 'html/>'."\n", |
|
| 1433 | + "\n".'</html', |
|
| 1434 | + 'head>'."\n", |
|
| 1435 | + "\n".'<head', |
|
| 1436 | + 'head/>'."\n", |
|
| 1437 | + "\n".'</head', |
|
| 1438 | 1438 | ], |
| 1439 | 1439 | [ |
| 1440 | 1440 | 'html>', |
@@ -1453,11 +1453,11 @@ discard block |
||
| 1453 | 1453 | $replace = []; |
| 1454 | 1454 | $replacement = []; |
| 1455 | 1455 | foreach (self::$selfClosingTags as $selfClosingTag) { |
| 1456 | - $replace[] = '<' . $selfClosingTag . '/>'; |
|
| 1457 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
| 1458 | - $replace[] = '<' . $selfClosingTag . ' />'; |
|
| 1459 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
| 1460 | - $replace[] = '></' . $selfClosingTag . '>'; |
|
| 1456 | + $replace[] = '<'.$selfClosingTag.'/>'; |
|
| 1457 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
| 1458 | + $replace[] = '<'.$selfClosingTag.' />'; |
|
| 1459 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
| 1460 | + $replace[] = '></'.$selfClosingTag.'>'; |
|
| 1461 | 1461 | $replacement[] = '>'; |
| 1462 | 1462 | } |
| 1463 | 1463 | $html = \str_replace( |
@@ -1665,7 +1665,7 @@ discard block |
||
| 1665 | 1665 | // ------------------------------------------------------------------------- |
| 1666 | 1666 | |
| 1667 | 1667 | return $dom->fixHtmlOutput( |
| 1668 | - $doctypeStr . $this->domNodeToString($dom->getDocument()), |
|
| 1668 | + $doctypeStr.$this->domNodeToString($dom->getDocument()), |
|
| 1669 | 1669 | $multiDecodeNewHtmlEntity |
| 1670 | 1670 | ); |
| 1671 | 1671 | } |
@@ -1710,7 +1710,7 @@ discard block |
||
| 1710 | 1710 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->parentNode()->innerHtml(); |
| 1711 | 1711 | $parentNode = $element->getNode()->parentNode; |
| 1712 | 1712 | if ($parentNode !== null) { |
| 1713 | - $parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
| 1713 | + $parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
| 1714 | 1714 | } |
| 1715 | 1715 | |
| 1716 | 1716 | ++$this->protected_tags_counter; |
@@ -1744,7 +1744,7 @@ discard block |
||
| 1744 | 1744 | } |
| 1745 | 1745 | |
| 1746 | 1746 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->innerhtml; |
| 1747 | - $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
| 1747 | + $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
| 1748 | 1748 | |
| 1749 | 1749 | ++$this->protected_tags_counter; |
| 1750 | 1750 | } |
@@ -1764,11 +1764,11 @@ discard block |
||
| 1764 | 1764 | continue; |
| 1765 | 1765 | } |
| 1766 | 1766 | |
| 1767 | - $this->protectedChildNodes[$this->protected_tags_counter] = '<!--' . $text . '-->'; |
|
| 1767 | + $this->protectedChildNodes[$this->protected_tags_counter] = '<!--'.$text.'-->'; |
|
| 1768 | 1768 | |
| 1769 | 1769 | /* @var $node \DOMComment */ |
| 1770 | 1770 | $node = $element->getNode(); |
| 1771 | - $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'); |
|
| 1771 | + $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'); |
|
| 1772 | 1772 | $parentNode = $element->getNode()->parentNode; |
| 1773 | 1773 | if ($parentNode !== null) { |
| 1774 | 1774 | $parentNode->replaceChild($child, $node); |