StrictTypesDeclarationRemover   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A leaveNode() 0 10 3
1
<?php
2
3
namespace Spatie\Php7to5\NodeVisitors;
4
5
use PhpParser\Node;
6
use PhpParser\Node\Stmt\DeclareDeclare;
7
use PhpParser\NodeTraverser;
8
use PhpParser\NodeVisitorAbstract;
9
10
class StrictTypesDeclarationRemover extends NodeVisitorAbstract
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function leaveNode(Node $node)
16
    {
17
        if (!$node instanceof DeclareDeclare) {
18
            return;
19
        }
20
21
        if ($node->key === 'strict_type') {
22
            return NodeTraverser::REMOVE_NODE;
23
        }
24
    }
25
}
26