Completed
Branch 2.x (867c01)
by Akihito
09:30
created

CodeGenVisitor::enterNode()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.2559

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 5
cp 0.6
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
crap 2.2559
1
<?php
2
/**
3
 * This file is part of the Ray.Aop package
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace Ray\Aop;
8
9
use PhpParser\Node;
10
use PhpParser\Node\Stmt\Use_;
11
use PhpParser\NodeVisitorAbstract;
12
13
class CodeGenVisitor extends NodeVisitorAbstract
14
{
15
    /**
16
     * @var Use_[]
17
     */
18
    private $use = [];
19
20 9
    public function enterNode(Node $node)
21
    {
22 9
        if ($node instanceof Use_) {
23
            $this->use[] = $node;
24
        }
25 9
    }
26
27
    /**
28
     * @return Node\Stmt\Use_[]
29
     */
30 9
    public function __invoke()
31
    {
32 9
        return $this->use;
33
    }
34
}
35