Skip to content

Commit a5d9414

Browse files
committed
minor #18212 [DomCrawler] Use XML_ELEMENT_NODE in nodeType check (rvanlaak)
This PR was merged into the 2.3 branch. Discussion ---------- [DomCrawler] Use XML_ELEMENT_NODE in nodeType check | Q | A | ------------- | --- | Branch? | 2.3+ | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Making use of the predefined dom constant `XML_ELEMENT_NODE` (which value is `1`) makes more sense while interpreting `parents()` it's functionality. See http://php.net/manual/en/dom.constants.php Commits ------- cffea91 Use XML_ELEMENT_NODE in nodeType check
2 parents d1b8414 + cffea91 commit a5d9414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public function parents()
455455
$nodes = array();
456456

457457
while ($node = $node->parentNode) {
458-
if (1 === $node->nodeType) {
458+
if (XML_ELEMENT_NODE === $node->nodeType) {
459459
$nodes[] = $node;
460460
}
461461
}

0 commit comments

Comments
 (0)