Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
esokullu authored Aug 20, 2019
1 parent b0fe72c commit 2b2ec80
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Pho/Kernel/Hooks/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace Pho\Kernel\Hooks;

use Pho\Lib\Graph;
use Pho\Lib\Graph\{HeadNode, TailNode};
use Pho\Framework\Predicate;

/**
* {@inheritDoc}
Expand All @@ -24,20 +26,25 @@ class Edge implements HookInterface
public static function setup(/*Graph\EdgeInterface*/ $edge): void
{
$edge->hook("head", (function(): Graph\NodeInterface {
$this->head = new \Pho\Lib\Graph\HeadNode();
$this->head = new HeadNode();
$this->head->set($this->injection("kernel")->gs()->node($this->head_id));
return $this->head;
})
);

$edge->hook("tail", (function(): Graph\NodeInterface {
$this->tail = new \Pho\Lib\Graph\TailNode();
$this->tail = new TailNode();
$this->tail->set($this->injection("kernel")->gs()->node($this->tail_id));
return $this->tail;
})
);
$edge->hook("predicate", (function(): Graph\PredicateInterface {
$this->predicate = (new $this->predicate);
if(!isset($this->predicate)) {
$this->predicate = $this->resolvePredicate(null, Predicate::class);
}
else {
$this->predicate = (new $this->predicate);
}
return $this->predicate;
})
);
Expand Down

0 comments on commit 2b2ec80

Please sign in to comment.