Completed
Pull Request — master (#293)
by Дмитрий
02:30
created

JumpIf   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setIf() 0 4 1
A setElse() 0 4 1
A getSubBlocks() 0 7 1
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\ControlFlow\Node;
7
8
class JumpIf extends AbstractNode
9
{
10
    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...
11
12
    protected $else;
13
14
    /**
15
     * @param mixed $if
16
     */
17
    public function setIf($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...
18
    {
19
        $this->if = $if;
20
    }
21
22
    /**
23
     * @param mixed $else
24
     */
25
    public function setElse($else)
26
    {
27
        $this->else = $else;
28
    }
29
30
    public function getSubBlocks()
31
    {
32
        return [
33
            'if' => $this->if,
34
            'else' => $this->else,
35
        ];
36
    }
37
}
38