public validateInput ( GraphAware\Common\Result\Result $result ) : GraphAware\Common\Type\Node | ||
$result | GraphAware\Common\Result\Result | |
return | GraphAware\Common\Type\Node |
public function validateInput($result)
{
if (count($result->records()) < 1 || !$result->getRecord()->value('input') instanceof Node) {
throw new \InvalidArgumentException(sprintf('Node not found'));
}
return $result->getRecord()->value('input');
}