Completed
Push — master ( 7f5500...64a288 )
by Дмитрий
04:56
created

GlobalVariable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
dl 0
loc 28
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSymbolType() 0 4 1
A isGlobal() 0 4 1
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 885
    public function __construct($name, $defaultValue = null, $type = CompiledExpression::UNKNOWN)
19
    {
20 885
        parent::__construct($name, $defaultValue, $type);
21 885
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getSymbolType()
27
    {
28
        return 'global-variable';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 48
    public function isGlobal()
35
    {
36 48
        return true;
37
    }
38
}
39