Skip to content

Commit

Permalink
changed error type
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Singer committed May 13, 2019
1 parent 86bdb46 commit b1d0aad
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/HtmlPageCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,20 +699,11 @@ public function replaceWith($content)
public function text($text = null)
{
if ($text === null) {
@trigger_error('In Version 2.0, Method text() will return the text from only the first element in the set. Consider using getCombinedText() instead.', E_USER_DEPRECATED);
$text = '';
foreach ($this as $node) {
/** @var \DOMNode $node */
$text .= $node->nodeValue;
}
return $text;
@trigger_error('In Version 2.0, Method text() will return the text from only the first element in the set. Consider using getCombinedText() instead.', E_USER_NOTICE);
return $this->getCombinedText();
} else {
@trigger_error('It will not be possible any more to use method text($text) as setter function in version 2.0. Use setText($text) instead.', E_USER_DEPRECATED);
foreach ($this as $node) {
/** @var \DOMNode $node */
$node->nodeValue = $text;
}
return $this;
return $this->setText($text);
}
}

Expand Down

0 comments on commit b1d0aad

Please sign in to comment.