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
08:06 queued 03:15
created

BountyPlace   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A build() 0 15 2
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Player\Headquarters;
4
5
use AbstractSmrPlayer;
6
use Menu;
7
use Smr\Database;
8
use Smr\Page\PlayerPage;
9
use Smr\Template;
10
11
class BountyPlace extends PlayerPage {
12
13
	public string $file = 'bounty_place.php';
14
15
	public function __construct(
16
		private readonly int $locationID
17
	) {}
18
19
	public function build(AbstractSmrPlayer $player, Template $template): void {
20
		$template->assign('PageTopic', 'Place Bounty');
21
22
		Menu::headquarters($this->locationID);
23
24
		$container = new BountyPlaceProcessor($this->locationID);
25
		$template->assign('SubmitHREF', $container->href());
26
27
		$bountyPlayers = [];
28
		$db = Database::getInstance();
29
		$dbResult = $db->read('SELECT player_id, player_name FROM player JOIN account USING(account_id) WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id != ' . $db->escapeNumber($player->getAccountID()) . ' ORDER BY player_name');
30
		foreach ($dbResult->records() as $dbRecord) {
31
			$bountyPlayers[$dbRecord->getInt('player_id')] = htmlentities($dbRecord->getString('player_name'));
32
		}
33
		$template->assign('BountyPlayers', $bountyPlayers);
34
	}
35
36
}
37