Completed
Push — master ( 8419d7...269912 )
by Дмитрий
03:29
created

Boolean   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getSubNodeNames() 0 4 1
A __construct() 0 5 1
A getType() 0 4 1
1
<?php
2
3
namespace PHPSA\Node\Scalar;
4
5
/**
6
 * Boolean node extension
7
 */
8
class Boolean extends \PhpParser\Node\Scalar
9
{
10
    /** @var boolean Number value */
11
    public $value;
12
13
    /**
14
     * Constructs a boolean node.
15
     *
16
     * @param boolean $value      Value of the number
17
     * @param array $attributes Additional attributes
18
     */
19
    public function __construct($value, array $attributes = array())
20
    {
21
        parent::__construct($attributes);
22
        $this->value = $value;
23
    }
24
25
    //@codeCoverageIgnoreStart
26
    /**
27
     * @return array
28
     */
29
    public function getSubNodeNames(): array
30
    {
31
        return ['value'];
32
    }
33
    //@codeCoverageIgnoreEnd
34
35
    /**
36
     * Gets the type of the node.
37
     *
38
     * @return string Type of the node
39
     */
40
    public function getType(): string
41
    {
42
        return 'Scalar_Boolean';
43
    }
44
}
45