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.
Passed
Push — master ( 7491d8...18e39d )
by Toby
43:56 queued 32:11
created

RoleTag::getFullReferenceAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Models\Tags;
4
5
use BristolSU\ControlDB\Scopes\RoleTagScope;
6
use BristolSU\ControlDB\Traits\Tags\RoleTagTrait;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\SoftDeletes;
9
10
/**
11
 * Class RoleTag
12
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
13
class RoleTag extends Model implements \BristolSU\ControlDB\Contracts\Models\Tags\RoleTag
14
{
15
    use SoftDeletes, RoleTagTrait;
16
17
    /**
18
     * Boot the model
19
     *
20
     * - Add a global scope to only return role tags
21
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
22 49
    protected static function boot()
23
    {
24 49
        parent::boot();
25 49
        static::addGlobalScope(new RoleTagScope());
26 49
    }
27
28
    /**
29
     * Table to use
30
     *
31
     * @var string
32
     */
33
    protected $table = 'control_tags';
34
35
    /**
36
     * Fillable properties
37
     *
38
     * @var array
39
     */
40
    protected $fillable = [
41
        'name', 'description', 'reference', 'tag_category_id'
42
    ];
43
44
    /**
45
     * Append the full reference
46
     *
47
     * @var array Attributes to append
48
     */
49
    protected $appends = [
50
        'full_reference'
51
    ];
52
53 7
    public function getFullReferenceAttribute()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function getFullReferenceAttribute()
Loading history...
54
    {
55 7
        return $this->fullReference();
56
    }
57
    
58
    /**
59
     * ID of the role tag
60
     *
61
     * @return int
62
     */
63 25
    public function id(): int
64
    {
65 25
        return $this->id;
66
    }
67
68
    /**
69
     * Name of the tag
70
     *
71
     * @return string
72
     */
73 3
    public function name(): string
74
    {
75 3
        return $this->name;
76
    }
77
78
    /**
79
     * Description of the tag
80
     *
81
     * @return string
82
     */
83 3
    public function description(): string
84
    {
85 3
        return $this->description;
86
    }
87
88
    /**
89
     * Reference of the tag
90
     *
91
     * @return string
92
     */
93 11
    public function reference(): string
94
    {
95 11
        return $this->reference;
96
    }
97
98
    /**
99
     * ID of the tag category
100
     *
101
     * @return int
102
     */
103 13
    public function categoryId(): int
104
    {
105 13
        return $this->tag_category_id;
106
    }
107
108
    /**
109
     * Set the name of the tag
110
     *
111
     * @param string $name
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
112
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
113 2
    public function setName(string $name): void
114
    {
115 2
        $this->name = $name;
116 2
        $this->save();
117 2
    }
118
119
    /**
120
     * Set the description of the tagTag Reference
121
     *
122
     * @param string $description
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
123
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
124 2
    public function setDescription(string $description): void
125
    {
126 2
        $this->description = $description;
127 2
        $this->save();
128 2
    }
129
130
    /**
131
     * Set the reference of the tag
132
     *
133
     * @param string $reference
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
134
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
135 2
    public function setReference(string $reference): void
136
    {
137 2
        $this->reference = $reference;
138 2
        $this->save();
139 2
    }
140
141
    /**
142
     * Set the tag category ID
143
     *
144
     * @param int $categoryId
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
145
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
146 2
    public function setTagCategoryId($categoryId): void
147
    {
148 2
        $this->tag_category_id = $categoryId;
149 2
        $this->save();
150 2
    }
151
152
}
153