Total Complexity | 9 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | final class LocoProject |
||
18 | { |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $name; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $apiKey; |
||
28 | |||
29 | 3 | /** |
|
30 | * @var string |
||
31 | 3 | */ |
|
32 | 3 | private $status; |
|
33 | 3 | ||
34 | 3 | /** |
|
35 | * @var string |
||
36 | */ |
||
37 | private $indexParameter; |
||
38 | |||
39 | 1 | /** |
|
40 | * @var array |
||
41 | 1 | */ |
|
42 | private $domains; |
||
43 | |||
44 | public function __construct(string $name, array $config) |
||
45 | { |
||
46 | $this->name = $name; |
||
47 | 1 | $this->apiKey = $config['api_key'] ?? null; |
|
48 | $this->status = $config['status'] ?? null; |
||
49 | 1 | $this->indexParameter = $config['index_parameter'] ?? null; |
|
50 | $this->domains = empty($config['domains']) ? [$name] : $config['domains']; |
||
51 | } |
||
52 | |||
53 | public function getName(): string |
||
54 | { |
||
55 | 1 | return $this->name; |
|
56 | } |
||
57 | 1 | ||
58 | public function getApiKey(): ?string |
||
59 | { |
||
60 | return $this->apiKey; |
||
61 | } |
||
62 | |||
63 | public function getStatus(): ?string |
||
64 | { |
||
65 | return $this->status; |
||
66 | } |
||
67 | |||
68 | public function getIndexParameter(): ?string |
||
69 | { |
||
70 | return $this->indexParameter; |
||
71 | } |
||
72 | |||
73 | public function getDomains(): array |
||
74 | { |
||
75 | return $this->domains; |
||
76 | } |
||
77 | |||
78 | public function hasDomain(string $domain): bool |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Returning true means that domains are expected to be managed with tags. |
||
85 | */ |
||
86 | public function isMultiDomain(): bool |
||
89 | } |
||
90 | } |
||
91 |