Total Complexity | 8 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class FinkokEnvironment |
||
8 | { |
||
9 | /** @var Definitions\Environment */ |
||
10 | private $environment; |
||
11 | |||
12 | 32 | private function __construct(Definitions\Environment $environment) |
|
13 | { |
||
14 | 32 | $this->environment = $environment; |
|
15 | 32 | } |
|
16 | |||
17 | /** @return static */ |
||
18 | 30 | public static function makeDevelopment(): self |
|
19 | { |
||
20 | 30 | return new self(Definitions\Environment::development()); |
|
21 | } |
||
22 | |||
23 | /** @return static */ |
||
24 | 2 | public static function makeProduction(): self |
|
25 | { |
||
26 | 2 | return new self(Definitions\Environment::production()); |
|
27 | } |
||
28 | |||
29 | 3 | public function isDevelopment(): bool |
|
32 | } |
||
33 | |||
34 | 3 | public function isProduction(): bool |
|
35 | { |
||
36 | 3 | return $this->environment->isProduction(); |
|
37 | } |
||
38 | |||
39 | 1 | public function server(): string |
|
40 | { |
||
41 | 1 | return $this->environment->value(); |
|
42 | } |
||
43 | |||
44 | 27 | public function endpoint(Definitions\Services $service): string |
|
52 | } |
||
53 | } |
||
54 |