summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2017-11-11 23:39:32 +0000
committerAndres Rey <[email protected]>2017-11-11 23:39:32 +0000
commitb13495916b35efbd548b4c174630fdc16ac9f447 (patch)
tree07830cdd8866644736c5406fa0ef71752bb69f17 /src
parent78abbeb6f6446cc6fde87d62499d03bb26941f7d (diff)
Allow getting all node ancestors
Diffstat (limited to 'src')
-rw-r--r--src/Readability.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Readability.php b/src/Readability.php
index 74cb71f..b5bc723 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -92,7 +92,7 @@ class Readability extends Element implements ReadabilityInterface
/**
* Get the ancestors of the current node.
*
- * @param int $maxLevel Max amount of ancestors to get.
+ * @param int|bool $maxLevel Max amount of ancestors to get. False for all of them
*
* @return array
*/
@@ -106,7 +106,7 @@ class Readability extends Element implements ReadabilityInterface
while ($node) {
$ancestors[] = $node;
$level++;
- if ($level >= $maxLevel) {
+ if ($level === $maxLevel) {
break;
}
$node = $node->getParent();