AbstractDefinition   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 52
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
compile() 0 1 ?
A setName() 0 4 1
A getName() 0 4 1
A getPointer() 0 4 1
A isCompiled() 0 4 1
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
/**
12
 * Shared Definition properties and methods
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
    public function getName()
38
    {
39
        return $this->name;
40
    }
41
42
    /**
43
     * @return ScopePointer
44
     */
45
    public function getPointer()
46
    {
47
        return new ScopePointer($this);
48
    }
49
50
    /**
51
     * @return boolean
52
     */
53
    public function isCompiled()
54
    {
55
        return $this->compiled;
56
    }
57
58
    /**
59
     * @param string $name
60
     */
61
    public function setName($name)
62
    {
63
        $this->name = $name;
64
    }
65
}
66