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

Fake::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
 * Fake scalar node for testing purposes
7
 */
8
class Fake extends \PhpParser\Node\Scalar
9
{
10
    /** @var mixed */
11
    public $value;
12
13
    /** @var mixed */
14
    public $type;
15
16
    /**
17
     * Constructs a fake node.
18
     *
19
     * @param mixed $value      Value of the Node
20
     * @param mixed $type      Type of the node
21
     * @param array $attributes Additional attributes
22
     */
23
    public function __construct($value, $type, array $attributes = array())
24
    {
25
        parent::__construct($attributes);
26
27
        $this->value = $value;
28
        $this->type = $type;
29
    }
30
31
    //@codeCoverageIgnoreStart
32
    /**
33
     * @return array
34
     */
35
    public function getSubNodeNames(): array
36
    {
37
        return ['value', 'type'];
38
    }
39
    //@codeCoverageIgnoreEnd
40
41
    /**
42
     * Gets the type of the node.
43
     *
44
     * @return string Type of the node
45
     */
46
    public function getType(): string
47
    {
48
        return 'Fake';
49
    }
50
}
51