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

CombatSimulator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 3
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Admin;
4
5
use DummyShip;
6
use Smr\Page\AccountPage;
7
use Smr\Template;
8
use SmrAccount;
9
10
class CombatSimulator extends AccountPage {
11
12
	public string $file = 'admin/combat_simulator.php';
13
14
	/**
15
	 * @param ?array<mixed> $results
16
	 * @param array<\AbstractSmrPlayer> $attackers
17
	 * @param array<\AbstractSmrPlayer> $defenders
18
	 */
19
	public function __construct(
20
		private readonly ?array $results = null,
21
		private readonly array $attackers = [],
22
		private readonly array $defenders = []
23
	) {}
24
25
	public function build(SmrAccount $account, Template $template): void {
26
		$template->assign('PageTopic', 'Combat Simulator');
27
28
		$template->assign('EditDummysLink', (new EditDummies())->href());
29
		$template->assign('DummyNames', DummyShip::getDummyNames());
30
31
		$duplicates = false;
32
33
		$attackers = $this->attackers;
34
		for ($i = count($attackers) + 1; $i <= MAXIMUM_PVP_FLEET_SIZE; ++$i) {
35
			$attackers[$i] = null;
36
		}
37
		$template->assign('Attackers', $attackers);
38
39
		$defenders = $this->defenders;
40
		for ($i = count($defenders) + 1; $i <= MAXIMUM_PVP_FLEET_SIZE; ++$i) {
41
			$defenders[$i] = null;
42
		}
43
		$template->assign('Defenders', $defenders);
44
45
		$template->assign('Duplicates', $duplicates);
46
47
		$template->assign('CombatSimHREF', (new CombatSimulatorProcessor())->href());
48
49
		$template->assign('TraderCombatResults', $this->results);
50
	}
51
52
}
53