diff options
author | Andres Rey <[email protected]> | 2018-11-07 18:52:21 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2018-11-07 18:52:21 +0000 |
commit | 0292ff115cfd28d472b378329a9932436e251fc7 (patch) | |
tree | f85f31c51c68900f57f4c858622a27f0496ebe86 /src/Nodes | |
parent | da2e712e3f7e4053c2b7202a701e6472c8409a28 (diff) |
Remove node parameter from "hasAncestorTag" since it's a trait and it works on itself
Diffstat (limited to 'src/Nodes')
-rw-r--r-- | src/Nodes/NodeTrait.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Nodes/NodeTrait.php b/src/Nodes/NodeTrait.php index 6aa5414..c08b59f 100644 --- a/src/Nodes/NodeTrait.php +++ b/src/Nodes/NodeTrait.php @@ -371,9 +371,11 @@ trait NodeTrait * * @return bool */ - public function hasAncestorTag($node, $tagName, $maxDepth = 3) + public function hasAncestorTag($tagName, $maxDepth = 3) { $depth = 0; + $node = $this; + while ($node->parentNode) { if ($maxDepth > 0 && $depth > $maxDepth) { return false; |