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 — main (#1494)
by Dan
10:59 queued 05:29
created

MessageBlacklist::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Player;
4
5
use AbstractSmrPlayer;
6
use Menu;
7
use Smr\Database;
8
use Smr\Page\PlayerPage;
9
use Smr\Template;
10
11
class MessageBlacklist extends PlayerPage {
12
13
	public string $file = 'message_blacklist.php';
14
15
	public function __construct(
16
		private readonly ?string $message = null
17
	) {}
18
19
	public function build(AbstractSmrPlayer $player, Template $template): void {
20
		$template->assign('PageTopic', 'Player Blacklist');
21
22
		Menu::messages();
23
24
		if ($this->message !== null) {
25
			$template->assign('Message', $this->message);
26
		}
27
28
		$db = Database::getInstance();
29
		$dbResult = $db->read('SELECT p.player_name, p.game_id, b.entry_id FROM player p JOIN message_blacklist b ON p.account_id = b.blacklisted_id AND b.game_id = p.game_id WHERE b.account_id=' . $db->escapeNumber($player->getAccountID()) . ' ORDER BY p.game_id, p.player_name');
30
31
		$blacklist = [];
32
		foreach ($dbResult->records() as $dbRecord) {
33
			$blacklist[] = $dbRecord->getRow();
34
		}
35
		$template->assign('Blacklist', $blacklist);
36
37
		if ($blacklist) {
38
			$container = new MessageBlacklistDeleteProcessor();
39
			$template->assign('BlacklistDeleteHREF', $container->href());
40
		}
41
42
		$container = new MessageBlacklistAddProcessor();
43
		$template->assign('BlacklistAddHREF', $container->href());
44
	}
45
46
}
47