Skip to content

Commit

Permalink
Add a new level parameter to the abstract visitor class and interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 11, 2018
1 parent e848e8b commit 697665c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Visitor/AbstractVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ abstract class AbstractVisitor implements VisitorInterface
/**
* {@inheritdoc}
*/
abstract public function traverse(NodeInterface $node): \Traversable;
abstract public function traverse(NodeInterface $node, int $level = null): \Traversable;
}
4 changes: 3 additions & 1 deletion src/Visitor/VisitorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ interface VisitorInterface
*
* @param \drupol\phptree\Node\NodeInterface $node
* The node.
* @param int|null $level
* The level.
*
* @return \Traversable
*/
public function traverse(NodeInterface $node): \Traversable;
public function traverse(NodeInterface $node, int $level = null): \Traversable;
}

0 comments on commit 697665c

Please sign in to comment.