Completed
Pull Request — master (#293)
by Дмитрий
04:41
created

ParentDefinition   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
dl 0
loc 52
ccs 9
cts 11
cp 0.8182
rs 10
c 0
b 0
f 0
wmc 5
lcom 0
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A getPointer() 0 4 1
A getNamespace() 0 4 1
A setNamespace() 0 4 1
A getCFG() 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\ScopePointer;
9
10
/**
11
 * Abstract Definition with namespace added
12
 */
13
abstract class ParentDefinition extends AbstractDefinition
14
{
15
    /**
16
     * @var string
17
     */
18
    protected $namespace;
19
20
    /**
21
     * @var \PHPSA\ControlFlow\ControlFlowGraph
22
     */
23
    protected $cfg;
24
25
    /**
26
     * @return string
27
     */
28 52
    public function getName()
29
    {
30 52
        return $this->name;
31
    }
32
33
    /**
34
     * @return ScopePointer
35
     */
36 8
    public function getPointer()
37
    {
38 8
        return new ScopePointer($this);
39
    }
40
41
    /**
42
     * @return string
43
     */
44 51
    public function getNamespace()
45
    {
46 51
        return $this->namespace;
47
    }
48
49
    /**
50
     * @param string $namespace
51
     */
52 51
    public function setNamespace($namespace)
53
    {
54 51
        $this->namespace = $namespace;
55 51
    }
56
57
    /**
58
     * @return \PHPSA\ControlFlow\ControlFlowGraph
59
     */
60
    public function getCFG()
61
    {
62
        return $this->cfg;
63
    }
64
}
65