Skip to content

Commit

Permalink
Remove no longer used methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 28, 2018
1 parent 552c0ea commit 478eef8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
14 changes: 0 additions & 14 deletions spec/drupol/phptree/Node/NodeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,6 @@ public function it_can_get_its_children()
->shouldYield(new \ArrayIterator([$node, $node]));
}

public function it_can_get_the_last_children()
{
$this
->lastChild()
->shouldReturn(null);

$node = new Node();

$this
->add($node)
->lastChild()
->shouldReturn($node);
}

public function it_can_check_if_its_a_leaf()
{
$this
Expand Down
8 changes: 0 additions & 8 deletions src/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ public function children(): \Traversable
yield from $this->storage['children'];
}

/**
* {@inheritdoc}
*/
public function lastChild(): ?NodeInterface
{
return $this->storage['children'][$this->storage['children']->count() - 1] ?? null;
}

/**
* {@inheritdoc}
*/
Expand Down
8 changes: 0 additions & 8 deletions src/Node/NodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,4 @@ public function depth(): int;
* The new object.
*/
public function withChildren(NodeInterface ...$nodes): NodeInterface;

/**
* Get the last child if any.
*
* @return \drupol\phptree\Node\NodeInterface|null
* The last child if any, null otherwise.
*/
public function lastChild(): ?NodeInterface;
}

0 comments on commit 478eef8

Please sign in to comment.