Completed
Push — master ( b7cb0e...ffcfdb )
by Дмитрий
02:53
created

AbstractDefinition::getPointer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA\Definition;
7
8
use PhpParser\Node;
9
use PHPSA\CompiledExpression;
10
use PHPSA\Context;
11
use PHPSA\ScopePointer;
12
use PHPSA\Variable;
13
14
abstract class AbstractDefinition
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $name;
20
21
    /**
22
     * Compile the definition
23
     *
24
     * @param Context $context
25
     * @return boolean
26
     */
27
    abstract public function compile(Context $context);
28
29
    /**
30
     * @var bool
31
     */
32
    protected $compiled = false;
33
34
    /**
35
     * @return string
36
     */
37 7
    public function getName()
38
    {
39 7
        return $this->name;
40
    }
41
42
    /**
43
     * @return ScopePointer
44
     */
45 6
    public function getPointer()
46
    {
47 6
        return new ScopePointer($this);
48
    }
49
50
    /**
51
     * @return boolean
52
     */
53 1
    public function isCompiled()
54
    {
55 1
        return $this->compiled;
56
    }
57
}
58