Total Complexity | 3 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | trait TaggableTrait |
||
7 | { |
||
8 | |||
9 | /** |
||
10 | * @var array |
||
11 | */ |
||
12 | protected $tags = []; |
||
13 | |||
14 | public function addTag(string $tag) |
||
15 | { |
||
16 | $this->tags[] = $tag; |
||
17 | return $this; |
||
18 | } |
||
19 | |||
20 | public function hasTag(string $tag): bool |
||
21 | { |
||
22 | return in_array($tag, $this->tags); |
||
23 | } |
||
24 | |||
25 | public function getTags(): array |
||
28 | } |
||
29 | } |
||
30 |