Completed
Push — master ( a74f2f...6e3ebc )
by Oskar
14s
created

Php7NodeTraverser::traverseArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 4
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Hal\Component\Ast;
3
4
use PhpParser\Node;
5
use PhpParser\NodeTraverser as Mother;
6
7 View Code Duplication
class Php7NodeTraverser extends Mother
0 ignored issues
show
Duplication introduced by
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...
8
{
9
    /** @var Traverser */
10
    private $traverser;
11
12
    public function __construct($cloneNodes = false, $stopCondition = null)
0 ignored issues
show
Unused Code introduced by
The parameter $cloneNodes is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
    {
14
        parent::__construct();
15
        $this->traverser = new Traverser($this, $stopCondition);
16
    }
17
18
    public function traverseNode(Node $node): Node
19
    {
20
        return parent::traverseNode($node);
21
    }
22
23
    protected function traverseArray(array $nodes): array
24
    {
25
        return $this->traverser->traverseArray($nodes, $this->visitors);
26
    }
27
}
28