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'); }