We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | class DatabaseProperties { |
||
8 | private const CONFIG_HOST = "MYSQL_HOST"; |
||
9 | private const CONFIG_USER = "MYSQL_USER"; |
||
10 | private const CONFIG_PASSWORD = "MYSQL_PASSWORD"; |
||
11 | private const CONFIG_DATABASE = "MYSQL_DATABASE"; |
||
12 | private string $host; |
||
13 | private string $user; |
||
14 | private string $password; |
||
15 | private string $databaseName; |
||
16 | |||
17 | public function __construct(Dotenv $config) { |
||
18 | $array = $config->load(); |
||
19 | self::validateConfig($config); |
||
20 | [ |
||
21 | self::CONFIG_HOST => $this->host, |
||
22 | self::CONFIG_USER => $this->user, |
||
23 | self::CONFIG_PASSWORD => $this->password, |
||
24 | self::CONFIG_DATABASE => $this->databaseName, |
||
25 | ] = $array; |
||
26 | } |
||
27 | |||
28 | private static function validateConfig(Dotenv $config) { |
||
35 | } |
||
36 | |||
37 | public function getHost(): string { |
||
38 | return $this->host; |
||
39 | } |
||
40 | |||
41 | public function getUser(): string { |
||
42 | return $this->user; |
||
43 | } |
||
44 | |||
45 | public function getPassword(): string { |
||
46 | return $this->password; |
||
47 | } |
||
48 | |||
49 | public function getDatabaseName(): string { |
||
51 | } |
||
52 | } |
||
53 |