diff options
author | Andres Rey <[email protected]> | 2017-11-11 23:39:32 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-11-11 23:39:32 +0000 |
commit | b13495916b35efbd548b4c174630fdc16ac9f447 (patch) | |
tree | 07830cdd8866644736c5406fa0ef71752bb69f17 /src | |
parent | 78abbeb6f6446cc6fde87d62499d03bb26941f7d (diff) |
Allow getting all node ancestors
Diffstat (limited to 'src')
-rw-r--r-- | src/Readability.php | 4 |
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(); |