Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Failed Conditions
Pull Request — master (#1038)
by Dan
04:32
created

DatabaseProperties::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Smr;
4
5
use Dotenv\Dotenv;
6
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) {
29
		$config->required([
30
			self::CONFIG_HOST,
31
			self::CONFIG_USER,
32
			self::CONFIG_PASSWORD,
33
			self::CONFIG_DATABASE,
34
		])->notEmpty();
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 {
50
		return $this->databaseName;
51
	}
52
}
53