This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
25
{
26
/**
27
* @var callable
28
*/
29
private $callback;
30
31
/**
32
* First constructor.
33
*
34
* @param callable $callback
35
*/
36
14
public function __construct(callable $callback)
37
{
38
14
$this->callback = $callback;
39
14
}
40
41
/**
42
* @param NodeInterface $node
43
*
44
* @return NodeCollectionInterface
45
*/
46
13
public function flow(NodeInterface $node)
47
{
48
13
if (!($node instanceof NodeCollectionInterface)) {
49
1
throw new InvalidArgumentException("The supplied $node is not a NodeCollectionInterface");
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.