Update Graph.php

This commit is contained in:
Dennis Eichhorn 2018-09-12 09:19:16 +02:00 committed by GitHub
parent 1bf1e6da3b
commit 65e0a5d024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,8 @@ class Graph
*/
public function addNodeRelative(Node $relative, Node $node) : Graph
{
$this->edges[] = new Edge($relative, $node);
return $this;
}
@ -199,10 +201,6 @@ class Graph
*/
public function getNeighbors($node) : array
{
if (!($node instanceof Node)) {
$node = $this->getNode($node);
}
$edges = $this->getEdgesOfNode($node);
$neighbors = [];