Completed
Push — develop ( 84bfed...2b68dc )
by Paul
02:42
created

AbstractAnnotation::setName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PhpUnitGen\Annotation;
4
5
use PhpUnitGen\Annotation\AnnotationInterface\AnnotationInterface;
6
7
/**
8
 * Class AbstractAnnotation.
9
 *
10
 * @author     Paul Thébaud <[email protected]>.
11
 * @copyright  2017-2018 Paul Thébaud <[email protected]>.
12
 * @license    https://opensource.org/licenses/MIT The MIT license.
13
 * @link       https://github.com/paul-thebaud/phpunit-generator
14
 * @since      Class available since Release 2.0.0.
15
 */
16
abstract class AbstractAnnotation implements AnnotationInterface
17
{
18
    /**
19
     * @var string $name The annotation name (such as "@PhpUnitGen\AssertTrue()").
20
     */
21
    private $name;
22
23
    /**
24
     * @var int $line The annotation line on documentation block.
25
     */
26
    private $line;
27
28
    /**
29
     * @var string|null $stringContent The string content of annotation, null if none.
30
     */
31
    private $stringContent;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    abstract public function getType(): int;
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    abstract public function compile(): void;
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function setName(string $name): void
47
    {
48
        $this->name = $name;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getName(): string
55
    {
56
        return $this->name;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function setLine(int $line): void
63
    {
64
        $this->line = $line;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function getLine(): int
71
    {
72
        return $this->line;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function setStringContent(?string $stringContent): void
79
    {
80
        $this->stringContent = $stringContent;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function getStringContent(): ?string
87
    {
88
        return $this->stringContent;
89
    }
90
}
91