Config   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 13
c 1
b 0
f 1
dl 0
loc 54
ccs 0
cts 23
cp 0
rs 10
wmc 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getTags() 0 3 1
A setUser() 0 3 1
A hasRelease() 0 3 1
A hasTags() 0 3 1
A setTags() 0 3 1
A getUser() 0 3 1
A hasUser() 0 3 1
A getRelease() 0 3 1
A addTag() 0 3 1
A setRelease() 0 3 1
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