Skip to content

Commit

Permalink
Let the NodeInterface::setParent() method accept a null parameter to …
Browse files Browse the repository at this point in the history
…remove the parent if any.
  • Loading branch information
drupol committed Dec 30, 2018
1 parent 87de76a commit db5f5a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function ($child) use ($nodes) {
/**
* {@inheritdoc}
*/
public function setParent(NodeInterface $node): NodeInterface
public function setParent(NodeInterface $node = null): NodeInterface
{
$this->storage['parent'] = $node;

Expand Down
2 changes: 1 addition & 1 deletion src/Node/NodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getParent(): ?NodeInterface;
* @return NodeInterface
* The node.
*/
public function setParent(NodeInterface $node): NodeInterface;
public function setParent(NodeInterface $node = null): NodeInterface;

/**
* The node to add.
Expand Down

0 comments on commit db5f5a6

Please sign in to comment.