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

Fake   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 0
cts 7
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 7 1
A getType() 0 4 1
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