GlobalVariable::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\Compiler;
7
8
use PHPSA\CompiledExpression;
9
use PHPSA\Variable;
10
11
class GlobalVariable extends Variable
12
{
13
    /**
14
     * @param string $name
15
     * @param mixed $defaultValue
16
     * @param int $type
17
     */
18 1
    public function __construct($name, $defaultValue = null, $type = CompiledExpression::UNKNOWN)
19
    {
20 1
        parent::__construct($name, $defaultValue, $type);
21 1
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getSymbolType()
27
    {
28
        return 'global-variable';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function isGlobal()
35
    {
36
        return true;
37
    }
38
}
39