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

Nil::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPSA\Node\Scalar;
4
5
/**
6
 * Null node extension
7
 */
8
class Nil extends \PhpParser\Node\Scalar
9
{
10
    /** @var null */
11
    public $value;
12
13
    /**
14
     * @param null $value
15
     * @param array $attributes Additional attributes
16
     */
17
    public function __construct($value = null, array $attributes = array())
18
    {
19
        parent::__construct($attributes);
20
        $this->value = $value;
21
    }
22
23
    //@codeCoverageIgnoreStart
24
    /**
25
     * @return array
26
     */
27
    public function getSubNodeNames(): array
28
    {
29
        return ['value'];
30
    }
31
    //@codeCoverageIgnoreEnd
32
33
    /**
34
     * Gets the type of the node.
35
     *
36
     * @return string Type of the node
37
     */
38
    public function getType(): string
39
    {
40
        return 'Scalar_Nil';
41
    }
42
}
43