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

StrictTypesDeclarationRemover   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A leaveNode() 0 8 3
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