Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
fab2s committed May 9, 2017
1 parent 140d8cf commit 3b9ef9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 1 addition & 5 deletions src/Nodes/CallableNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ class CallableNode extends PayloadNodeAbstract implements TraversableNodeInterfa
*
* @throws NodalFlowException
*/
public function __construct($payload, $isAReturningVal, $isATraversable = false)
public function __construct(callable $payload, $isAReturningVal, $isATraversable = false)
{
if (!\is_callable($payload)) {
throw new NodalFlowException('Payload is not callable');
}

parent::__construct($payload, $isAReturningVal, $isATraversable);
}

Expand Down
8 changes: 2 additions & 6 deletions src/Nodes/ClosureNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Class ClosureNode
*/
class ClosureNode extends PayloadNodeAbstract implements TraversableNodeInterface, ExecNodeInterface
class ClosureNode extends CallableNode
{
/**
* Instantiate a Closure Node
Expand All @@ -25,12 +25,8 @@ class ClosureNode extends PayloadNodeAbstract implements TraversableNodeInterfac
*
* @throws NodalFlowException
*/
public function __construct($payload, $isAReturningVal, $isATraversable = false)
public function __construct(\Closure $payload, $isAReturningVal, $isATraversable = false)
{
if (!($payload instanceof \Closure)) {
throw new NodalFlowException('Payload is not a Closure');
}

parent::__construct($payload, $isAReturningVal, $isATraversable);
}

Expand Down

0 comments on commit 3b9ef9b

Please sign in to comment.