Completed
Push — master ( fc51f9...b3b654 )
by Freek
03:59
created

StrictTypesDeclarationRemover::leaveNode()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 5
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