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

ParentDefinition::setNamespace()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
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\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