Completed
Push — master ( 4eb3b6...7be634 )
by Freek
05:29 queued 03:34
created

StrictTypesDeclarationRemover::leaveNode()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 8
rs 9.4285
c 1
b 0
f 1
cc 3
eloc 4
nc 3
nop 1
1
<?php
2
3
namespace Spatie\Php7to5;
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
            if ($node->key === 'strict_type') {
19
                return NodeTraverser::REMOVE_NODE;
20
            }
21
        }
22
    }
23
}
24