Solved Unit tests

This commit is contained in:
Kevin Frantz
2018-11-18 11:34:38 +01:00
parent 00c6ba1f9d
commit 0d0fa68094
2 changed files with 6 additions and 6 deletions

View File

@@ -103,15 +103,14 @@ final class TreeSourceService extends AbstractSourceService implements TreeSourc
public function getAllLeaves(): Collection
{
$leaves = new ArrayCollection();
foreach ($this->getAllBranches()->toArray() as $branch) {
foreach ((new self($branch))->getLeaves() as $leave) {
$leaves = new ArrayCollection($this->getLeaves()->toArray());
foreach ($this->getAllBranches() as $branch) {
foreach ((new self($branch))->getAllLeaves() as $leave) {
if (! $leaves->contains($leave)) {
$leaves->add($leave);
}
}
}
return $leaves;
}
}