Skip to content

Commit 4877615

Browse files
mr-chetanpopov654
andcommitted
Fix typo and clear innerText in HtmlNode
Corrected a typo in the circular reference exception message in InnerNode. Added clearing of innerText property in HtmlNode's clear method to ensure all relevant cached properties are reset. https: //github.com/paquettg/pull/324 Co-Authored-By: Alexandr Popov <[email protected]>
1 parent 23d53b1 commit 4877615

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/PHPHtmlParser/Dom/Node/HtmlNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ protected function clear(): void
235235
$this->outerHtml = null;
236236
$this->text = null;
237237
$this->textWithChildren = null;
238+
$this->innerText = null;
238239

239240
if ($this->parent !== null) {
240241
$this->parent->clear();

src/PHPHtmlParser/Dom/Node/InnerNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getChildren(): array
9494
$childrenIds[] = $child->id;
9595
$child = $this->nextChild($child->id());
9696
if (in_array($child->id, $childrenIds, true)) {
97-
throw new CircularException('Circular sibling referance found. Child with id ' . $child->id() . ' found twice.');
97+
throw new CircularException('Circular sibling reference found on child with id ' . $child->id() . ' found twice.');
9898
}
9999
} while (true);
100100
} catch (ChildNotFoundException $e) {

0 commit comments

Comments
 (0)