Completed
Push — master ( 41b58d...a7bf65 )
by Дмитрий
04:42
created

AbstractDefinition::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
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\Definition;
7
8
use PHPSA\Context;
9
use PHPSA\ScopePointer;
10
11
abstract class AbstractDefinition
12
{
13
    /**
14
     * @var string
15
     */
16
    protected $name;
17
18
    /**
19
     * Compile the definition
20
     *
21
     * @param Context $context
22
     * @return boolean
23
     */
24
    abstract public function compile(Context $context);
25
26
    /**
27
     * @var bool
28
     */
29
    protected $compiled = false;
30
31
    /**
32
     * @return string
33
     */
34 25
    public function getName()
35
    {
36 25
        return $this->name;
37
    }
38
39
    /**
40
     * @return ScopePointer
41
     */
42 24
    public function getPointer()
43
    {
44 24
        return new ScopePointer($this);
45
    }
46
47
    /**
48
     * @return boolean
49
     */
50 1
    public function isCompiled()
51
    {
52 1
        return $this->compiled;
53
    }
54
55
    /**
56
     * @param string $name
57
     */
58
    public function setName($name)
59
    {
60
        $this->name = $name;
61
    }
62
}
63