Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update to address another clear related issue
  • Loading branch information
mallardduck committed Dec 29, 2016
commit f557f95fe75e219748cc1d31b10852d296df5017
10 changes: 5 additions & 5 deletions src/PHPHtmlParser/Dom/AbstractNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ public function delete()
if ( ! is_null($this->parent)) {
$this->parent->removeChild($this->id);
}

$this->parent = null;
$this->parent->clear();
$this->clear();
}

/**
Expand Down Expand Up @@ -307,7 +307,7 @@ public function setAttribute($key, $value)

//clear any cache
$this->clear();

return $this;
}

Expand All @@ -321,7 +321,7 @@ public function setAttribute($key, $value)
public function removeAttribute($key)
{
$this->tag->removeAttribute($key);

//clear any cache
$this->clear();
}
Expand All @@ -335,7 +335,7 @@ public function removeAttribute($key)
public function removeAllAttributes()
{
$this->tag->removeAllAttributes();

//clear any cache
$this->clear();
}
Expand Down
3 changes: 3 additions & 0 deletions src/PHPHtmlParser/Dom/HtmlNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ protected function clear()
$this->innerHtml = null;
$this->outerHtml = null;
$this->text = null;
if (is_null($this->parent) === false) {
$this->parent->clear();
}
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/PHPHtmlParser/Dom/MockNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ protected function clear()
$this->innerHtml = null;
$this->outerHtml = null;
$this->text = null;
if (is_null($this->parent) === false) {
$this->parent->clear();
}
}

/**
Expand Down