MagicalInstantiation   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A enter() 0 12 3
1
<?php
2
3
namespace Solidifier\Visitors\DependencyInjection;
4
5
use Solidifier\Parser\Visitors\ContextualVisitor;
6
use PhpParser\Node;
7
use PhpParser\Node\Name;
8
use PhpParser\Node\Expr\New_;
9
10
class MagicalInstantiation extends ContextualVisitor
11
{
12
    protected function enter(Node $node)
13
    {
14
        if($node instanceof New_)
15
        {
16
            if(! $node->class instanceof Name)
17
            {
18
                $this->dispatch(
19
                    new \Solidifier\Defects\MagicUsage($node)
20
                );
21
            }
22
        }
23
    }
24
}
25