StrictTypesDeclarationRemover::leaveNode()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 3
nc 3
nop 1
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