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

Passed
Pull Request — master (#924)
by Dan
04:13
created

MySqlProperties::getPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
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 MySqlProperties {
8
	private const CONFIG_MYSQL_HOST = "MYSQL_HOST";
9
	private const CONFIG_MYSQL_USER = "MYSQL_USER";
10
	private const CONFIG_MYSQL_PASSWORD = "MYSQL_PASSWORD";
11
	private const CONFIG_MYSQL_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_MYSQL_HOST => $this->host,
22
			self::CONFIG_MYSQL_USER => $this->user,
23
			self::CONFIG_MYSQL_PASSWORD => $this->password,
24
			self::CONFIG_MYSQL_DATABASE => $this->databaseName,
25
		] = $array;
26
	}
27
28
	private static function validateConfig(Dotenv $config) {
29
		$config->required(self::CONFIG_MYSQL_HOST);
30
		$config->required(self::CONFIG_MYSQL_USER);
31
		$config->required(self::CONFIG_MYSQL_PASSWORD);
32
		$config->required(self::CONFIG_MYSQL_DATABASE);
33
	}
34
35
	public function getHost(): string {
36
		return $this->host;
37
	}
38
39
	public function getUser(): string {
40
		return $this->user;
41
	}
42
43
	public function getPassword(): string {
44
		return $this->password;
45
	}
46
47
	public function getDatabaseName(): string {
48
		return $this->databaseName;
49
	}
50
}
51