Config::setUser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Logfile;
4
5
class Config
6
{
7
    use Traits\Path;
8
9
    protected $tags = [];
10
11
    public function hasTags(): bool
12
    {
13
        return !empty($this->tags);
14
    }
15
16
    public function getTags(): array
17
    {
18
        return $this->tags;
19
    }
20
21
    public function setTags(array $tags): void
22
    {
23
        $this->tags = $tags;
24
    }
25
26
    public function addTag(string $key, $value): void
27
    {
28
        $this->tags[$key] = $value;
29
    }
30
31
    public function hasUser(): bool
32
    {
33
        return !empty($this->tags['user']);
34
    }
35
36
    public function getUser(): array
37
    {
38
        return $this->tags['user'] ?? [];
39
    }
40
41
    public function setUser(array $user): void
42
    {
43
        $this->tags['user'] = $user;
44
    }
45
46
    public function hasRelease(): bool
47
    {
48
        return !empty($this->tags['release']);
49
    }
50
51
    public function getRelease(): string
52
    {
53
        return $this->tags['release'] ?? '';
54
    }
55
56
    public function setRelease(string $release)
57
    {
58
        $this->tags['release'] = $release;
59
    }
60
}
61