Completed
Push — hotfix-use ( fcb514 )
by Akihito
01:38
created

CodeVisitor::enterNode()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Aop;
6
7
use PhpParser\Node;
8
use PhpParser\Node\Stmt\Declare_;
9
use PhpParser\Node\Stmt\Use_;
10
use PhpParser\NodeVisitorAbstract;
11
12
final class CodeVisitor extends NodeVisitorAbstract
13
{
14
    /**
15
     * @var Declare_[]
16
     */
17
    public $declare;
18
19
    /**
20
     * @var Use_[]
21
     */
22
    public $use;
23
24
    public function enterNode(Node $node)
25
    {
26
        if ($node instanceof Declare_) {
27
            $this->declare[] = $node;
28
        }
29
        if ($node instanceof Use_) {
30
            $this->use[] = $node;
31
        }
32
    }
33
}
34