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
Push — main ( 30fe2e...c58695 )
by Dan
04:45
created

SetSectorProcessor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildBetaFunctionsProcessor() 0 12 2
1
<?php declare(strict_types=1);
2
3
namespace Smr\Pages\Player\BetaFunctions;
4
5
use AbstractSmrPlayer;
6
use Smr\Request;
7
use Smr\SectorLock;
8
use SmrSector;
9
10
class SetSectorProcessor extends BetaFunctionsPageProcessor {
11
12
	public function buildBetaFunctionsProcessor(AbstractSmrPlayer $player): void {
13
		$sector_to = Request::getInt('sector_to');
14
		if (!SmrSector::sectorExists($player->getGameID(), $sector_to)) {
15
			create_error('Sector ID is not in any galaxy.');
16
		}
17
		$player->setSectorID($sector_to);
18
		$player->setLandedOnPlanet(false);
19
		// Update sector lock
20
		$player->update();
21
		$lock = SectorLock::getInstance();
22
		$lock->release();
23
		$lock->acquireForPlayer($player);
24
	}
25
26
}
27