Completed
Pull Request — master (#293)
by Дмитрий
05:14 queued 02:19
created

JumpIf::getSubBlocks()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
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\Block;
9
10
class JumpIf extends AbstractNode
11
{
12
    /**
13
     * @var Block
14
     */
15
    protected $if;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $if. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
16
17
    /**
18
     * @var Block|null
19
     */
20
    protected $else;
21
22
    public function __construct(Block $if)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $if. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
23
    {
24
        $this->if = $if;
25
    }
26
27
    /**
28
     * @param Block $if
29
     */
30
    public function setIf(Block $if)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $if. Configured minimum length is 3.

Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.

Loading history...
31
    {
32
        $this->if = $if;
33
    }
34
35
    /**
36
     * @param Block $else
37
     */
38
    public function setElse(Block $else)
39
    {
40
        $this->else = $else;
41
    }
42
43
    public function getSubBlocks()
44
    {
45
        return [
46
            'if' => $this->if,
47
            'else' => $this->else,
48
        ];
49
    }
50
}
51