Completed
Pull Request — master (#293)
by Дмитрий
06:57 queued 04:10
created

ReturnNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 37.5%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 30
ccs 3
cts 8
cp 0.375
rs 10
c 1
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A willExit() 0 4 1
A getSubVariables() 0 6 1
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\ControlFlow\Node;
7
8
use PHPSA\ControlFlow\Node\AbstractNode;
9
10
class ReturnNode extends AbstractNode
11
{
12
    /**
13
     * @var AbstractNode|null
14
     */
15
    public $expr;
16
17 4
    public function __construct(AbstractNode $node = null)
18
    {
19 4
        $this->expr = $node;
20 4
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function willExit()
26
    {
27
        return true;
28
    }
29
30
    /**
31
     * @return array
32
     */
33
    public function getSubVariables()
34
    {
35
        return [
36
            'expr' => $this->expr
37
        ];
38
    }
39
}
40