@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | $tmpStr = $this->normalizeStringForComparision($string); |
418 | 418 | if ($tmpDomString !== $tmpStr) { |
419 | 419 | throw new \RuntimeException( |
420 | - 'Not valid HTML fragment!' . "\n" . |
|
421 | - $tmpDomString . "\n" . |
|
420 | + 'Not valid HTML fragment!'."\n". |
|
421 | + $tmpDomString."\n". |
|
422 | 422 | $tmpStr |
423 | 423 | ); |
424 | 424 | } |
@@ -490,8 +490,8 @@ discard block |
||
490 | 490 | $tmpStr = $this->normalizeStringForComparision($string); |
491 | 491 | if ($tmpDomOuterTextString !== $tmpStr) { |
492 | 492 | throw new \RuntimeException( |
493 | - 'Not valid HTML fragment!' . "\n" |
|
494 | - . $tmpDomOuterTextString . "\n" . |
|
493 | + 'Not valid HTML fragment!'."\n" |
|
494 | + . $tmpDomOuterTextString."\n". |
|
495 | 495 | $tmpStr |
496 | 496 | ); |
497 | 497 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | /** |
459 | 459 | * Returns the first child of node. |
460 | 460 | * |
461 | - * @return SimpleHtmlDomInterface|null |
|
461 | + * @return null|SimpleHtmlDom |
|
462 | 462 | */ |
463 | 463 | public function firstChild() |
464 | 464 | { |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | /** |
605 | 605 | * Returns the last child of node. |
606 | 606 | * |
607 | - * @return SimpleHtmlDomInterface|null |
|
607 | + * @return null|SimpleHtmlDom |
|
608 | 608 | */ |
609 | 609 | public function lastChild() |
610 | 610 | { |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | /** |
622 | 622 | * Returns the next sibling of node. |
623 | 623 | * |
624 | - * @return SimpleHtmlDomInterface|null |
|
624 | + * @return null|SimpleHtmlDom |
|
625 | 625 | */ |
626 | 626 | public function nextSibling() |
627 | 627 | { |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | /** |
639 | 639 | * Returns the next sibling of node. |
640 | 640 | * |
641 | - * @return SimpleHtmlDomInterface|null |
|
641 | + * @return null|SimpleHtmlDom |
|
642 | 642 | */ |
643 | 643 | public function nextNonWhitespaceSibling() |
644 | 644 | { |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | /** |
671 | 671 | * Returns the previous sibling of node. |
672 | 672 | * |
673 | - * @return SimpleHtmlDomInterface|null |
|
673 | + * @return null|SimpleHtmlDom |
|
674 | 674 | */ |
675 | 675 | public function previousSibling() |
676 | 676 | { |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | /** |
689 | 689 | * Returns the previous sibling of node. |
690 | 690 | * |
691 | - * @return SimpleHtmlDomInterface|null |
|
691 | + * @return null|SimpleHtmlDom |
|
692 | 692 | */ |
693 | 693 | public function previousNonWhitespaceSibling() |
694 | 694 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | return \call_user_func_array([$this, self::$functionAliases[$name]], $arguments); |
84 | 84 | } |
85 | 85 | |
86 | - throw new \BadMethodCallException('Method does not exist: ' . $name); |
|
86 | + throw new \BadMethodCallException('Method does not exist: '.$name); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -389,12 +389,12 @@ discard block |
||
389 | 389 | $regExSpecialScript = '/<(script)(?<attr>[^>]*)>(?<content>.*)<\/\1>/isU'; |
390 | 390 | $htmlTmp = \preg_replace_callback( |
391 | 391 | $regExSpecialScript, |
392 | - static function ($scripts) { |
|
392 | + static function($scripts) { |
|
393 | 393 | if (empty($scripts['content'])) { |
394 | 394 | return $scripts[0]; |
395 | 395 | } |
396 | 396 | |
397 | - return '<script' . $scripts['attr'] . '>' . \str_replace('</', '<\/', $scripts['content']) . '</script>'; |
|
397 | + return '<script'.$scripts['attr'].'>'.\str_replace('</', '<\/', $scripts['content']).'</script>'; |
|
398 | 398 | }, |
399 | 399 | $html |
400 | 400 | ); |
@@ -423,14 +423,14 @@ discard block |
||
423 | 423 | self::$domReplaceHelper['orig'] |
424 | 424 | ); |
425 | 425 | |
426 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<' . self::$domHtmlWrapperHelper . '>'; |
|
427 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</' . self::$domHtmlWrapperHelper . '>'; |
|
426 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__start'] = '<'.self::$domHtmlWrapperHelper.'>'; |
|
427 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_wrapper__end'] = '</'.self::$domHtmlWrapperHelper.'>'; |
|
428 | 428 | |
429 | 429 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__start'] = ''; |
430 | 430 | $DOM_REPLACE__HELPER_CACHE['orig']['html_wrapper__end'] = ''; |
431 | 431 | |
432 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<' . self::$domHtmlSpecialScriptHelper; |
|
433 | - $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</' . self::$domHtmlSpecialScriptHelper . '>'; |
|
432 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__start'] = '<'.self::$domHtmlSpecialScriptHelper; |
|
433 | + $DOM_REPLACE__HELPER_CACHE['tmp']['html_special_script__end'] = '</'.self::$domHtmlSpecialScriptHelper.'>'; |
|
434 | 434 | |
435 | 435 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__start'] = '<script'; |
436 | 436 | $DOM_REPLACE__HELPER_CACHE['orig']['html_special_script__end'] = '</script>'; |
@@ -65,7 +65,7 @@ |
||
65 | 65 | return (string) $this; |
66 | 66 | } |
67 | 67 | |
68 | - throw new \InvalidArgumentException('Undefined property: $' . $name); |
|
68 | + throw new \InvalidArgumentException('Undefined property: $'.$name); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -41,5 +41,5 @@ |
||
41 | 41 | $document = new \voku\helper\HtmlDomParser($html); |
42 | 42 | |
43 | 43 | foreach (find_contains($document, '.lall', 'foo') as $child_dom) { |
44 | - echo $child_dom->html() . "\n"; |
|
44 | + echo $child_dom->html()."\n"; |
|
45 | 45 | } |
@@ -24,5 +24,5 @@ |
||
24 | 24 | $data = scraping_imdb('http://imdb.com/title/tt0335266/'); |
25 | 25 | |
26 | 26 | foreach ($data as $k => $v) { |
27 | - echo '<strong>' . $k . ' </strong>' . $v . '<br>'; |
|
27 | + echo '<strong>'.$k.' </strong>'.$v.'<br>'; |
|
28 | 28 | } |
@@ -34,6 +34,6 @@ |
||
34 | 34 | |
35 | 35 | foreach ($data as $v) { |
36 | 36 | foreach ($v as $k_inner => $v_inner) { |
37 | - echo '<strong>' . $k_inner . ':</strong> ' . $v_inner . '<br><br>'; |
|
37 | + echo '<strong>'.$k_inner.':</strong> '.$v_inner.'<br><br>'; |
|
38 | 38 | } |
39 | 39 | } |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | /** |
419 | 419 | * Returns the first child of node. |
420 | 420 | * |
421 | - * @return SimpleXmlDomInterface|null |
|
421 | + * @return null|SimpleXmlDom |
|
422 | 422 | */ |
423 | 423 | public function firstChild() |
424 | 424 | { |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | /** |
577 | 577 | * Returns the last child of node. |
578 | 578 | * |
579 | - * @return SimpleXmlDomInterface|null |
|
579 | + * @return null|SimpleXmlDom |
|
580 | 580 | */ |
581 | 581 | public function lastChild() |
582 | 582 | { |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | /** |
594 | 594 | * Returns the next sibling of node. |
595 | 595 | * |
596 | - * @return SimpleXmlDomInterface|null |
|
596 | + * @return null|SimpleXmlDom |
|
597 | 597 | */ |
598 | 598 | public function nextSibling() |
599 | 599 | { |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | /** |
611 | 611 | * Returns the next sibling of node. |
612 | 612 | * |
613 | - * @return SimpleXmlDomInterface|null |
|
613 | + * @return null|SimpleXmlDom |
|
614 | 614 | */ |
615 | 615 | public function nextNonWhitespaceSibling() |
616 | 616 | { |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | /** |
643 | 643 | * Returns the previous sibling of node. |
644 | 644 | * |
645 | - * @return SimpleXmlDomInterface|null |
|
645 | + * @return null|SimpleXmlDom |
|
646 | 646 | */ |
647 | 647 | public function previousSibling() |
648 | 648 | { |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | $tmpStr = $this->normalizeStringForComparision($string); |
163 | 163 | if ($tmpDomString !== $tmpStr) { |
164 | 164 | throw new \RuntimeException( |
165 | - 'Not valid XML fragment!' . "\n" . |
|
166 | - $tmpDomString . "\n" . |
|
165 | + 'Not valid XML fragment!'."\n". |
|
166 | + $tmpDomString."\n". |
|
167 | 167 | $tmpStr |
168 | 168 | ); |
169 | 169 | } |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | $tmpStr = $this->normalizeStringForComparision($string); |
222 | 222 | if ($tmpDomOuterTextString !== $tmpStr) { |
223 | 223 | throw new \RuntimeException( |
224 | - 'Not valid XML fragment!' . "\n" |
|
225 | - . $tmpDomOuterTextString . "\n" . |
|
224 | + 'Not valid XML fragment!'."\n" |
|
225 | + . $tmpDomOuterTextString."\n". |
|
226 | 226 | $tmpStr |
227 | 227 | ); |
228 | 228 | } |
@@ -171,7 +171,7 @@ |
||
171 | 171 | * |
172 | 172 | * @param string $class |
173 | 173 | * |
174 | - * @return SimpleHtmlDomInterface[]|SimpleHtmlDomNodeInterface<SimpleHtmlDomInterface> |
|
174 | + * @return SimpleHtmlDomNodeInterface |
|
175 | 175 | */ |
176 | 176 | public function getElementByClass(string $class); |
177 | 177 |
@@ -170,7 +170,7 @@ |
||
170 | 170 | * |
171 | 171 | * @param string $class |
172 | 172 | * |
173 | - * @return SimpleXmlDomInterface[]|SimpleXmlDomNodeInterface<SimpleXmlDomInterface> |
|
173 | + * @return SimpleXmlDomNodeInterface |
|
174 | 174 | */ |
175 | 175 | public function getElementByClass(string $class); |
176 | 176 |