Total Complexity | 9 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 20% |
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 | 4 | public function __construct(string $templatesDir = '', array $env = []) |
|
14 | { |
||
15 | 4 | $this->templatesDir = $templatesDir; |
|
16 | 4 | $this->env = $env; |
|
17 | 4 | } |
|
18 | |||
19 | public function getTemplatesDir(): string |
||
20 | { |
||
21 | return $this->templatesDir; |
||
22 | } |
||
23 | |||
24 | public function getToAddress(): string |
||
25 | { |
||
26 | return $this->env['TO_ADDRESS']; |
||
27 | } |
||
28 | |||
29 | public function getMailerUsername(): string |
||
30 | { |
||
31 | return $this->env['MAILER_USERNAME']; |
||
32 | } |
||
33 | |||
34 | public function getMailerPassword(): string |
||
35 | { |
||
36 | return $this->env['MAILER_PASSWORD']; |
||
37 | } |
||
38 | |||
39 | public function getSlackDestinyChannelId(): string |
||
40 | { |
||
41 | return $this->env['SLACK_DESTINY_CHANNEL_ID']; |
||
42 | } |
||
43 | |||
44 | public function getSlackBotUserOauthAccessToken(): string |
||
47 | } |
||
48 | |||
49 | public function isDebug(): bool |
||
50 | { |
||
51 | return $this->isTrue($this->env['DEBUG'] ?? null); |
||
52 | } |
||
53 | |||
54 | private function isTrue(?string $bool): bool |
||
57 | } |
||
58 | } |
||
59 |