@@ -442,10 +442,10 @@ |
||
442 | 442 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
443 | 443 | function ($matches) { |
444 | 444 | return $matches['start'] . |
445 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
446 | - $matches['value'] . |
|
447 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
448 | - $matches['end']; |
|
445 | + '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
446 | + $matches['value'] . |
|
447 | + '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
448 | + $matches['end']; |
|
449 | 449 | }, |
450 | 450 | $html |
451 | 451 | ); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @var string[][] |
46 | 46 | */ |
47 | 47 | protected static $domLinkReplaceHelper = [ |
48 | - 'orig' => ['[', ']', '{', '}',], |
|
48 | + 'orig' => ['[', ']', '{', '}', ], |
|
49 | 49 | 'tmp' => [ |
50 | 50 | '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_LEFT____', |
51 | 51 | '____SIMPLE_HTML_DOM__VOKU__SQUARE_BRACKET_RIGHT____', |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
165 | 165 | } |
166 | 166 | |
167 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
167 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | |
280 | 280 | if (!empty($linksOld[1])) { |
281 | 281 | $linksOld = $linksOld[1]; |
282 | - foreach ((array)$linksOld as $linkKey => $linkOld) { |
|
282 | + foreach ((array) $linksOld as $linkKey => $linkOld) { |
|
283 | 283 | $linksNew[$linkKey] = \str_replace( |
284 | 284 | self::$domLinkReplaceHelper['orig'], |
285 | 285 | self::$domLinkReplaceHelper['tmp'], |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $xmlHackUsed = false; |
397 | 397 | if (\stripos('<?xml', $html) !== 0) { |
398 | 398 | $xmlHackUsed = true; |
399 | - $html = '<?xml encoding="' . $this->getEncoding() . '" ?>' . $html; |
|
399 | + $html = '<?xml encoding="'.$this->getEncoding().'" ?>'.$html; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | $html = self::replaceToPreserveHtmlEntities($html); |
@@ -438,13 +438,13 @@ discard block |
||
438 | 438 | do { |
439 | 439 | $original = $html; |
440 | 440 | |
441 | - $html = (string)preg_replace_callback( |
|
441 | + $html = (string) preg_replace_callback( |
|
442 | 442 | '/(?<start>.*)<(?<element_start>[a-z]+)(?<element_start_addon> [^>]*)?>(?<value>.*?)<\/(?<element_end>\2)>(?<end>.*)/sui', |
443 | - function ($matches) { |
|
444 | - return $matches['start'] . |
|
445 | - '°lt_simple_html_dom__voku_°' . $matches['element_start'] . $matches['element_start_addon'] . '°gt_simple_html_dom__voku_°' . |
|
446 | - $matches['value'] . |
|
447 | - '°lt/_simple_html_dom__voku_°' . $matches['element_end'] . '°gt_simple_html_dom__voku_°' . |
|
443 | + function($matches) { |
|
444 | + return $matches['start']. |
|
445 | + '°lt_simple_html_dom__voku_°'.$matches['element_start'].$matches['element_start_addon'].'°gt_simple_html_dom__voku_°'. |
|
446 | + $matches['value']. |
|
447 | + '°lt/_simple_html_dom__voku_°'.$matches['element_end'].'°gt_simple_html_dom__voku_°'. |
|
448 | 448 | $matches['end']; |
449 | 449 | }, |
450 | 450 | $html |
@@ -458,9 +458,9 @@ discard block |
||
458 | 458 | do { |
459 | 459 | $original = $html; |
460 | 460 | |
461 | - $html = (string)preg_replace_callback( |
|
461 | + $html = (string) preg_replace_callback( |
|
462 | 462 | '/(?<start>[^<]*)?(?<broken>(?:(?:<\/\w+(?:\s+\w+=\\"[^\"]+\\")*+)(?:[^<]+)>)+)(?<end>.*)/u', |
463 | - function ($matches) { |
|
463 | + function($matches) { |
|
464 | 464 | |
465 | 465 | $matches['broken'] = str_replace( |
466 | 466 | ['°lt/_simple_html_dom__voku_°', '°lt_simple_html_dom__voku_°', '°gt_simple_html_dom__voku_°'], |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | //var_dump($matches['broken']); |
472 | 472 | |
473 | 473 | self::$domBrokenReplaceHelper['orig'][] = $matches['broken']; |
474 | - self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____' . crc32($matches['broken']); |
|
474 | + self::$domBrokenReplaceHelper['tmp'][] = $matchesHash = '____simple_html_dom__voku__broken_html____'.crc32($matches['broken']); |
|
475 | 475 | |
476 | - return $matches['start'] . $matchesHash . $matches['end']; |
|
476 | + return $matches['start'].$matchesHash.$matches['end']; |
|
477 | 477 | }, |
478 | 478 | $html |
479 | 479 | ); |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | ); |
491 | 491 | |
492 | 492 | if ($backup !== $html) { |
493 | - $html = '<____simple_html_dom__voku__broken_html_wrapper____>' . $html . '</____simple_html_dom__voku__broken_html_wrapper____>'; |
|
493 | + $html = '<____simple_html_dom__voku__broken_html_wrapper____>'.$html.'</____simple_html_dom__voku__broken_html_wrapper____>'; |
|
494 | 494 | } |
495 | 495 | |
496 | 496 | return $html; |
@@ -666,8 +666,8 @@ discard block |
||
666 | 666 | } |
667 | 667 | |
668 | 668 | if ($this->isDOMDocumentCreatedWithoutWrapper === true) { |
669 | - $content = (string)\preg_replace('/^<p>/', '', $content); |
|
670 | - $content = (string)\preg_replace('/<\/p>/', '', $content); |
|
669 | + $content = (string) \preg_replace('/^<p>/', '', $content); |
|
670 | + $content = (string) \preg_replace('/<\/p>/', '', $content); |
|
671 | 671 | } |
672 | 672 | |
673 | 673 | if ($this->isDOMDocumentCreatedWithoutHtml === true) { |
@@ -837,7 +837,7 @@ discard block |
||
837 | 837 | $xml = $this->document->saveXML(null, \LIBXML_NOEMPTYTAG); |
838 | 838 | |
839 | 839 | // remove the XML-header |
840 | - $xml = \ltrim((string)\preg_replace('/<\?xml.*\?>/', '', $xml)); |
|
840 | + $xml = \ltrim((string) \preg_replace('/<\?xml.*\?>/', '', $xml)); |
|
841 | 841 | |
842 | 842 | return $this->fixHtmlOutput($xml, $multiDecodeNewHtmlEntity); |
843 | 843 | } |