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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 33
rs 10
c 1
b 0
f 0
wmc 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A build() 0 25 4
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