Completed
Pull Request — master (#47)
by Povilas
02:04
created

ReturnExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A extend() 0 4 1
1
<?php
2
3
namespace Povils\PHPMND\Extension;
4
5
use PhpParser\Node;
6
use PhpParser\Node\Stmt\Return_;
7
8
/**
9
 * Class ReturnExtension
10
 *
11
 * @package Povils\PHPMND\Extension
12
 */
13
class ReturnExtension implements Extension
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public function getName()
19
    {
20
        return 'return';
21
    }
22
23
    /**
24
     * @inheritdoc
25
     */
26
    public function extend(Node $node)
27
    {
28
        return $node->getAttribute('parent') instanceof Return_;
29
    }
30
}
31