Total Complexity | 9 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class StockTickerConfig implements StockTickerConfigInterface |
||
8 | { |
||
9 | private string $templatesDir; |
||
10 | |||
11 | private array $env; |
||
12 | |||
13 | 13 | public function __construct(string $templatesDir = '', array $env = []) |
|
17 | 13 | } |
|
18 | |||
19 | 1 | public function getTemplatesDir(): string |
|
20 | { |
||
21 | 1 | return $this->templatesDir; |
|
22 | } |
||
23 | |||
24 | 1 | public function getToAddress(): string |
|
25 | { |
||
26 | 1 | return $this->env['TO_ADDRESS']; |
|
27 | } |
||
28 | |||
29 | 1 | public function getMailerUsername(): string |
|
30 | { |
||
31 | 1 | return $this->env['MAILER_USERNAME']; |
|
32 | } |
||
33 | |||
34 | 1 | public function getMailerPassword(): string |
|
35 | { |
||
36 | 1 | return $this->env['MAILER_PASSWORD']; |
|
37 | } |
||
38 | |||
39 | 1 | public function getSlackDestinyChannelId(): string |
|
40 | { |
||
41 | 1 | return $this->env['SLACK_DESTINY_CHANNEL_ID']; |
|
42 | } |
||
43 | |||
44 | 1 | public function getSlackBotUserOauthAccessToken(): string |
|
47 | } |
||
48 | |||
49 | 6 | public function isDebug(): bool |
|
50 | { |
||
51 | 6 | return $this->isTrue($this->env['DEBUG'] ?? null); |
|
52 | } |
||
53 | |||
54 | 6 | private function isTrue(?string $bool): bool |
|
57 | } |
||
58 | } |
||
59 |