@@ -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 | } |
@@ -994,8 +994,8 @@ discard block |
||
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | if ($child instanceof \DOMElement) { |
| 997 | - $html .= \rtrim('<' . $child->tagName . ' ' . $this->domNodeAttributesToString($child)); |
|
| 998 | - $html .= '>' . $this->domNodeToString($child); |
|
| 997 | + $html .= \rtrim('<'.$child->tagName.' '.$this->domNodeAttributesToString($child)); |
|
| 998 | + $html .= '>'.$this->domNodeToString($child); |
|
| 999 | 999 | |
| 1000 | 1000 | if ( |
| 1001 | 1001 | !( |
@@ -1008,7 +1008,7 @@ discard block |
||
| 1008 | 1008 | $this->domNodeClosingTagOptional($child) |
| 1009 | 1009 | ) |
| 1010 | 1010 | ) { |
| 1011 | - $html .= '</' . $child->tagName . '>'; |
|
| 1011 | + $html .= '</'.$child->tagName.'>'; |
|
| 1012 | 1012 | } |
| 1013 | 1013 | |
| 1014 | 1014 | if (!$this->doRemoveWhitespaceAroundTags) { |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | $html .= $child->wholeText; |
| 1074 | 1074 | } |
| 1075 | 1075 | } elseif ($child instanceof \DOMComment) { |
| 1076 | - $html .= '<!--' . $child->textContent . '-->'; |
|
| 1076 | + $html .= '<!--'.$child->textContent.'-->'; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | } |
| 1079 | 1079 | |
@@ -1106,9 +1106,9 @@ discard block |
||
| 1106 | 1106 | $tmpTypePublic = 'PUBLIC'; |
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | - return '<!DOCTYPE ' . $child->name |
|
| 1110 | - . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') |
|
| 1111 | - . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') |
|
| 1109 | + return '<!DOCTYPE '.$child->name |
|
| 1110 | + . ($child->publicId ? ' '.$tmpTypePublic.' "'.$child->publicId.'"' : '') |
|
| 1111 | + . ($child->systemId ? ' '.$tmpTypeSystem.' "'.$child->systemId.'"' : '') |
|
| 1112 | 1112 | . '>'; |
| 1113 | 1113 | } |
| 1114 | 1114 | } |
@@ -1373,18 +1373,18 @@ discard block |
||
| 1373 | 1373 | if (\strpos($html, ' ') !== false) { |
| 1374 | 1374 | $htmlCleaned = \preg_replace_callback( |
| 1375 | 1375 | '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#', |
| 1376 | - static function ($matches) { |
|
| 1377 | - return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; |
|
| 1376 | + static function($matches) { |
|
| 1377 | + return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>'; |
|
| 1378 | 1378 | }, |
| 1379 | 1379 | $html |
| 1380 | 1380 | ); |
| 1381 | 1381 | if ($htmlCleaned !== null) { |
| 1382 | - $html = (string)$htmlCleaned; |
|
| 1382 | + $html = (string) $htmlCleaned; |
|
| 1383 | 1383 | } else { |
| 1384 | 1384 | $htmlCleaned = (string) \preg_replace_callback( |
| 1385 | 1385 | '#<([^/\s<>!]+)(?:\s+([^<>]*)\s*|\s*)(/?)>#', |
| 1386 | - static function ($matches) { |
|
| 1387 | - return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; |
|
| 1386 | + static function($matches) { |
|
| 1387 | + return '<'.$matches[1].\preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]).$matches[3].'>'; |
|
| 1388 | 1388 | }, |
| 1389 | 1389 | $html |
| 1390 | 1390 | ); |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | |
| 1407 | 1407 | if (\strpos($html, $this->protectedChildNodesHelper) !== false) { |
| 1408 | 1408 | $html = (string) \preg_replace_callback( |
| 1409 | - '/<(?<element>' . $this->protectedChildNodesHelper . ')(?<attributes> [^>]*)?>(?<value>.*?)<\/' . $this->protectedChildNodesHelper . '>/', |
|
| 1409 | + '/<(?<element>'.$this->protectedChildNodesHelper.')(?<attributes> [^>]*)?>(?<value>.*?)<\/'.$this->protectedChildNodesHelper.'>/', |
|
| 1410 | 1410 | [$this, 'restoreProtectedHtml'], |
| 1411 | 1411 | $html |
| 1412 | 1412 | ); |
@@ -1426,14 +1426,14 @@ discard block |
||
| 1426 | 1426 | |
| 1427 | 1427 | $html = \str_replace( |
| 1428 | 1428 | [ |
| 1429 | - 'html>' . "\n", |
|
| 1430 | - "\n" . '<html', |
|
| 1431 | - 'html/>' . "\n", |
|
| 1432 | - "\n" . '</html', |
|
| 1433 | - 'head>' . "\n", |
|
| 1434 | - "\n" . '<head', |
|
| 1435 | - 'head/>' . "\n", |
|
| 1436 | - "\n" . '</head', |
|
| 1429 | + 'html>'."\n", |
|
| 1430 | + "\n".'<html', |
|
| 1431 | + 'html/>'."\n", |
|
| 1432 | + "\n".'</html', |
|
| 1433 | + 'head>'."\n", |
|
| 1434 | + "\n".'<head', |
|
| 1435 | + 'head/>'."\n", |
|
| 1436 | + "\n".'</head', |
|
| 1437 | 1437 | ], |
| 1438 | 1438 | [ |
| 1439 | 1439 | 'html>', |
@@ -1452,11 +1452,11 @@ discard block |
||
| 1452 | 1452 | $replace = []; |
| 1453 | 1453 | $replacement = []; |
| 1454 | 1454 | foreach (self::$selfClosingTags as $selfClosingTag) { |
| 1455 | - $replace[] = '<' . $selfClosingTag . '/>'; |
|
| 1456 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
| 1457 | - $replace[] = '<' . $selfClosingTag . ' />'; |
|
| 1458 | - $replacement[] = '<' . $selfClosingTag . '>'; |
|
| 1459 | - $replace[] = '></' . $selfClosingTag . '>'; |
|
| 1455 | + $replace[] = '<'.$selfClosingTag.'/>'; |
|
| 1456 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
| 1457 | + $replace[] = '<'.$selfClosingTag.' />'; |
|
| 1458 | + $replacement[] = '<'.$selfClosingTag.'>'; |
|
| 1459 | + $replace[] = '></'.$selfClosingTag.'>'; |
|
| 1460 | 1460 | $replacement[] = '>'; |
| 1461 | 1461 | } |
| 1462 | 1462 | $html = \str_replace( |
@@ -1663,7 +1663,7 @@ discard block |
||
| 1663 | 1663 | // ------------------------------------------------------------------------- |
| 1664 | 1664 | |
| 1665 | 1665 | return $dom->fixHtmlOutput( |
| 1666 | - $doctypeStr . $this->domNodeToString($dom->getDocument()), |
|
| 1666 | + $doctypeStr.$this->domNodeToString($dom->getDocument()), |
|
| 1667 | 1667 | $multiDecodeNewHtmlEntity |
| 1668 | 1668 | ); |
| 1669 | 1669 | } |
@@ -1708,7 +1708,7 @@ discard block |
||
| 1708 | 1708 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->parentNode()->innerHtml(); |
| 1709 | 1709 | $parentNode = $element->getNode()->parentNode; |
| 1710 | 1710 | if ($parentNode !== null) { |
| 1711 | - $parentNode->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
| 1711 | + $parentNode->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
| 1712 | 1712 | } |
| 1713 | 1713 | |
| 1714 | 1714 | ++$this->protected_tags_counter; |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | } |
| 1743 | 1743 | |
| 1744 | 1744 | $this->protectedChildNodes[$this->protected_tags_counter] = $element->innerhtml; |
| 1745 | - $element->getNode()->nodeValue = '<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'; |
|
| 1745 | + $element->getNode()->nodeValue = '<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'; |
|
| 1746 | 1746 | |
| 1747 | 1747 | ++$this->protected_tags_counter; |
| 1748 | 1748 | } |
@@ -1762,11 +1762,11 @@ discard block |
||
| 1762 | 1762 | continue; |
| 1763 | 1763 | } |
| 1764 | 1764 | |
| 1765 | - $this->protectedChildNodes[$this->protected_tags_counter] = '<!--' . $text . '-->'; |
|
| 1765 | + $this->protectedChildNodes[$this->protected_tags_counter] = '<!--'.$text.'-->'; |
|
| 1766 | 1766 | |
| 1767 | 1767 | /* @var $node \DOMComment */ |
| 1768 | 1768 | $node = $element->getNode(); |
| 1769 | - $child = new \DOMText('<' . $this->protectedChildNodesHelper . ' data-' . $this->protectedChildNodesHelper . '="' . $this->protected_tags_counter . '"></' . $this->protectedChildNodesHelper . '>'); |
|
| 1769 | + $child = new \DOMText('<'.$this->protectedChildNodesHelper.' data-'.$this->protectedChildNodesHelper.'="'.$this->protected_tags_counter.'"></'.$this->protectedChildNodesHelper.'>'); |
|
| 1770 | 1770 | $parentNode = $element->getNode()->parentNode; |
| 1771 | 1771 | if ($parentNode !== null) { |
| 1772 | 1772 | $parentNode->replaceChild($child, $node); |
@@ -1899,7 +1899,7 @@ discard block |
||
| 1899 | 1899 | |
| 1900 | 1900 | $doSkip = false; |
| 1901 | 1901 | foreach (self::$skipTagsForRemoveWhitespace as $pattern) { |
| 1902 | - if (\strpos($xp, '/' . $pattern) !== false) { |
|
| 1902 | + if (\strpos($xp, '/'.$pattern) !== false) { |
|
| 1903 | 1903 | $doSkip = true; |
| 1904 | 1904 | |
| 1905 | 1905 | break; |