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

ReturnNode::getSubVariables()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 3
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
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