GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AnnotationDefinition::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 7
cts 7
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
crap 2
1
<?php
2
3
namespace Wingu\OctopusCore\Reflection\Annotation;
4
5
/**
6
 * Class that holds the raw output of the annotation parser for one annotation.
7
 */
8
class AnnotationDefinition
9
{
10
11
    /**
12
     * The tag name of the annotation.
13
     *
14
     * @var string
15
     */
16
    protected $tag;
17
18
    /**
19
     * The description text for the annotation.
20
     *
21
     * @var string
22
     */
23
    protected $description;
24
25
    /**
26
     * Constructor.
27
     *
28
     * @param string $tag The tag name for the annotation.
29
     * @param string $description The annotation description.
30
     */
31 177
    public function __construct($tag, $description = null)
32
    {
33 177
        $this->tag = (string)$tag;
34
35 177
        $description = trim((string)$description);
36 177
        if ($description !== '') {
37 66
            $this->description = $description;
38 22
        }
39 177
    }
40
41
    /**
42
     * Get the tag name.
43
     *
44
     * @return string
45
     */
46 30
    public function getTag()
47
    {
48 30
        return $this->tag;
49
    }
50
51
    /**
52
     * Get the description.
53
     *
54
     * @return string
55
     */
56 30
    public function getDescription()
57
    {
58 30
        return $this->description;
59
    }
60
}
61