| Total Complexity | 14 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | class Config |
||
| 6 | { |
||
| 7 | protected $path = ''; |
||
| 8 | |||
| 9 | protected $tags = []; |
||
| 10 | |||
| 11 | protected $user = []; |
||
| 12 | |||
| 13 | protected $release = ''; |
||
| 14 | |||
| 15 | public function hasPath(): bool |
||
| 18 | } |
||
| 19 | |||
| 20 | public function getPath(): string |
||
| 21 | { |
||
| 22 | return $this->path; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function setPath(string $path): void |
||
| 26 | { |
||
| 27 | $realpath = realpath($path); |
||
| 28 | |||
| 29 | if (false === $realpath) { |
||
| 30 | throw new \InvalidArgumentException('Path does not exist: '.$path); |
||
| 31 | } |
||
| 32 | |||
| 33 | $this->path = $realpath . '/'; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function hasTags(): bool |
||
| 37 | { |
||
| 38 | return !empty($this->tags); |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getTags(): array |
||
| 44 | } |
||
| 45 | |||
| 46 | public function setTags(array $tags): void |
||
| 47 | { |
||
| 48 | $this->tags = $tags; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function addTag(string $key, $value): void |
||
| 52 | { |
||
| 53 | $this->tags[$key] = $value; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function hasUser(): bool |
||
| 57 | { |
||
| 58 | return !empty($this->user); |
||
| 59 | } |
||
| 60 | |||
| 61 | public function getUser(): array |
||
| 62 | { |
||
| 63 | return $this->user; |
||
| 64 | } |
||
| 65 | |||
| 66 | public function setUser(array $user): void |
||
| 69 | } |
||
| 70 | |||
| 71 | public function hasRelease(): bool |
||
| 74 | } |
||
| 75 | |||
| 76 | public function getRelease(): string |
||
| 77 | { |
||
| 78 | return $this->release; |
||
| 79 | } |
||
| 80 | |||
| 81 | public function setRelease(string $release) |
||
| 86 |