Skip to content

Commit

Permalink
bugfix: getters return nodes, not edges
Browse files Browse the repository at this point in the history
  • Loading branch information
Emre Sokullu committed May 3, 2017
1 parent 119b2f4 commit 5d337a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Pho/Framework/ParticleTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ protected function _callSetter(string $name, array $args): AbstractEdge
*
* @param string $name Catch-all method name
* @param array $args Catch-all method arguments
*
* @return array An array of ParticleInterface objects
*
* @throws Exceptions\InvalidParticleMethodException when no matching method found.
Expand All @@ -248,7 +249,7 @@ protected function _callGetter(string $name, array $args): array
$return = [];
array_walk($edges_out, function($item, $key) use (&$return, $name) {
if($item instanceof $this->edge_out_getter_classes[$name])
$return[] = $item;
$return[] = $item();
});
return $return;
}
Expand All @@ -257,7 +258,7 @@ protected function _callGetter(string $name, array $args): array
$return = [];
array_walk($edges_in, function($item, $key) use (&$return, $name) {
if($item instanceof $this->edge_in_getter_classes[$name])
$return[] = $item;
$return[] = $item->tail()->node();
});
return $return;
}
Expand Down

0 comments on commit 5d337a2

Please sign in to comment.