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

CodeVisitor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A enterNode() 0 9 3
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