Completed
Push — master ( f29cb1...1705d4 )
by Povilas
8s
created

SwitchCaseExtension::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Povils\PHPMND\Extension;
4
5
use PhpParser\Node;
6
use PhpParser\Node\Stmt\Case_;
7
8
/**
9
 * Class SwitchCaseExtension
10
 *
11
 * @package Povils\PHPMND\Extension
12
 */
13
class SwitchCaseExtension implements Extension
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function getName()
19
    {
20
        return 'switch_case';
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function extend(Node $node)
27
    {
28
        return $node->getAttribute('parent') instanceof Case_;
29
    }
30
}
31