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

Passed
Pull Request — master (#1004)
by Dan
06:40
created
src/lib/Default/AbstractSmrPort.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
 			do {
1220 1220
 				$targetPlayer = array_rand_value($targetPlayers);
1221 1221
 			} while ($results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()] > min($results['TotalShotsPerTargetPlayer']));
1222
-			$results['Weapons'][$orderID] =& $weapon->shootPlayerAsPort($this, $targetPlayer);
1222
+			$results['Weapons'][$orderID] = & $weapon->shootPlayerAsPort($this, $targetPlayer);
1223 1223
 			$results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()]++;
1224 1224
 			if ($results['Weapons'][$orderID]['Hit']) {
1225 1225
 				$results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
@@ -1228,7 +1228,7 @@  discard block
 block discarded – undo
1228 1228
 		}
1229 1229
 		if ($this->hasCDs()) {
1230 1230
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true);
1231
-			$results['Drones'] =& $thisCDs->shootPlayerAsPort($this, array_rand_value($targetPlayers));
1231
+			$results['Drones'] = & $thisCDs->shootPlayerAsPort($this, array_rand_value($targetPlayers));
1232 1232
 			$results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage'];
1233 1233
 			$results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage'];
1234 1234
 		}
Please login to merge, or discard this patch.
src/lib/Default/SmrForce.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -460,20 +460,20 @@
 block discarded – undo
460 460
 
461 461
 		if ($this->hasMines()) {
462 462
 			$thisMines = new SmrMines($this->getGameID(), $this->getMines());
463
-			$results['Results']['Mines'] =& $thisMines->shootPlayerAsForce($this, array_rand_value($targetPlayers), $minesAreAttacker);
463
+			$results['Results']['Mines'] = & $thisMines->shootPlayerAsForce($this, array_rand_value($targetPlayers), $minesAreAttacker);
464 464
 			$results['TotalDamage'] += $results['Results']['Mines']['ActualDamage']['TotalDamage'];
465 465
 		}
466 466
 
467 467
 		if ($this->hasCDs()) {
468 468
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs());
469
-			$results['Results']['Drones'] =& $thisCDs->shootPlayerAsForce($this, array_rand_value($targetPlayers));
469
+			$results['Results']['Drones'] = & $thisCDs->shootPlayerAsForce($this, array_rand_value($targetPlayers));
470 470
 			$results['TotalDamage'] += $results['Results']['Drones']['ActualDamage']['TotalDamage'];
471 471
 		}
472 472
 
473 473
 		if (!$minesAreAttacker) {
474 474
 			if ($this->hasSDs()) {
475 475
 				$thisSDs = new SmrScoutDrones($this->getGameID(), $this->getSDs());
476
-				$results['Results']['Scouts'] =& $thisSDs->shootPlayerAsForce($this, array_rand_value($targetPlayers));
476
+				$results['Results']['Scouts'] = & $thisSDs->shootPlayerAsForce($this, array_rand_value($targetPlayers));
477 477
 				$results['TotalDamage'] += $results['Results']['Scouts']['ActualDamage']['TotalDamage'];
478 478
 			}
479 479
 		}
Please login to merge, or discard this patch.
src/lib/Smr/SocialLogin/Twitter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 		}
36 36
 		$helper = self::getTwitterObj($_SESSION['TwitterToken']);
37 37
 		$accessToken = $helper->oauth('oauth/access_token',
38
-		                              ['oauth_verifier' => \Request::get('oauth_verifier')]);
38
+									  ['oauth_verifier' => \Request::get('oauth_verifier')]);
39 39
 		$auth = self::getTwitterObj($accessToken);
40 40
 		$userInfo = $auth->get('account/verify_credentials', ['include_email' => 'true']);
41 41
 		if ($auth->getLastHttpCode() == 200) {
Please login to merge, or discard this patch.
src/lib/Default/SmrGalaxy.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@
 block discarded – undo
340 340
 	/**
341 341
 	 * Check if the galaxy contains a specific sector.
342 342
 	 */
343
-	public function contains(int | SmrSector $sectorID) : bool {
343
+	public function contains(int|SmrSector $sectorID) : bool {
344 344
 		if ($sectorID instanceof SmrSector) {
345 345
 			return $sectorID->getGalaxyID() == $this->getGalaxyID();
346 346
 		}
Please login to merge, or discard this patch.
src/admin/Default/ip_view_results.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
 	}
97 97
 	$accountID = (int)$variable;
98 98
 	$template->assign('BanAccountID', $accountID);
99
-	$summary = 'Account ' . $accountID. ' has had the following IPs at the following times.';
99
+	$summary = 'Account ' . $accountID . ' has had the following IPs at the following times.';
100 100
 	$template->assign('Summary', $summary);
101 101
 	$db2->query('SELECT * FROM account_exceptions WHERE account_id = ' . $db->escapeNumber($variable));
102 102
 	if ($db2->nextRecord()) {
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrCombatWeapon.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -67,68 +67,68 @@
 block discarded – undo
67 67
 	abstract public function &getModifiedPlanetDamageAgainstPlayer(SmrPlanet $planet, AbstractSmrPlayer $targetPlayer);
68 68
 
69 69
 	protected function &doPlayerDamageToForce(array &$return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) {
70
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstForces($weaponPlayer,$forces);
71
-		$return['ActualDamage'] =& $forces->doWeaponDamage($return['WeaponDamage']);
70
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstForces($weaponPlayer, $forces);
71
+		$return['ActualDamage'] = & $forces->doWeaponDamage($return['WeaponDamage']);
72 72
 		if ($return['ActualDamage']['KillingShot']) {
73
-			$return['KillResults'] =& $forces->killForcesByPlayer($weaponPlayer);
73
+			$return['KillResults'] = & $forces->killForcesByPlayer($weaponPlayer);
74 74
 		}
75 75
 		return $return;
76 76
 	}
77 77
 
78 78
 	protected function &doPlayerDamageToPlayer(array &$return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) {
79
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer);
80
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
79
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer);
80
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
81 81
 
82 82
 		if ($return['ActualDamage']['KillingShot']) {
83
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlayer($weaponPlayer);
83
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlayer($weaponPlayer);
84 84
 		}
85 85
 		return $return;
86 86
 	}
87 87
 
88 88
 	protected function &doPlayerDamageToPort(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) {
89
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPort($weaponPlayer,$port);
90
-		$return['ActualDamage'] =& $port->doWeaponDamage($return['WeaponDamage']);
89
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPort($weaponPlayer, $port);
90
+		$return['ActualDamage'] = & $port->doWeaponDamage($return['WeaponDamage']);
91 91
 		if ($return['ActualDamage']['KillingShot']) {
92
-			$return['KillResults'] =& $port->killPortByPlayer($weaponPlayer);
92
+			$return['KillResults'] = & $port->killPortByPlayer($weaponPlayer);
93 93
 		}
94 94
 		return $return;
95 95
 	}
96 96
 
97 97
 	protected function &doPlayerDamageToPlanet(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) {
98
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet);
99
-		$return['ActualDamage'] =& $planet->doWeaponDamage($return['WeaponDamage'],$delayed);
98
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet);
99
+		$return['ActualDamage'] = & $planet->doWeaponDamage($return['WeaponDamage'], $delayed);
100 100
 		if ($return['ActualDamage']['KillingShot']) {
101
-			$return['KillResults'] =& $planet->killPlanetByPlayer($weaponPlayer);
101
+			$return['KillResults'] = & $planet->killPlanetByPlayer($weaponPlayer);
102 102
 		}
103 103
 		return $return;
104 104
 	}
105 105
 
106 106
 	protected function &doPortDamageToPlayer(array &$return, SmrPort $port, AbstractSmrPlayer $targetPlayer) {
107
-		$return['WeaponDamage'] =& $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer);
108
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
107
+		$return['WeaponDamage'] = & $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer);
108
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
109 109
 
110 110
 		if ($return['ActualDamage']['KillingShot']) {
111
-			$return['KillResults'] =& $targetPlayer->killPlayerByPort($port);
111
+			$return['KillResults'] = & $targetPlayer->killPlayerByPort($port);
112 112
 		}
113 113
 		return $return;
114 114
 	}
115 115
 
116 116
 	protected function &doPlanetDamageToPlayer(array &$return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) {
117
-		$return['WeaponDamage'] =& $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer);
118
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
117
+		$return['WeaponDamage'] = & $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer);
118
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
119 119
 
120 120
 		if ($return['ActualDamage']['KillingShot']) {
121
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlanet($planet);
121
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlanet($planet);
122 122
 		}
123 123
 		return $return;
124 124
 	}
125 125
 
126 126
 	protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) {
127
-		$return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer);
128
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
127
+		$return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer);
128
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
129 129
 
130 130
 		if ($return['ActualDamage']['KillingShot']) {
131
-			$return['KillResults'] =& $targetPlayer->killPlayerByForces($forces);
131
+			$return['KillResults'] = & $targetPlayer->killPlayerByForces($forces);
132 132
 		}
133 133
 		return $return;
134 134
 	}
Please login to merge, or discard this patch.
src/lib/Default/ChessPiece.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	}
235 235
 
236 236
 	public static function getLetterForPiece(int $pieceID, string $colour) : string {
237
-		$letter = match ($pieceID) {
237
+		$letter = match($pieceID) {
238 238
 			self::KING => 'k',
239 239
 			self::QUEEN => 'q',
240 240
 			self::ROOK => 'r',
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	}
250 250
 
251 251
 	public static function getPieceForLetter(string $letter) : int {
252
-		return match (strtolower($letter)) {
252
+		return match(strtolower($letter)) {
253 253
 			'k' => self::KING,
254 254
 			'q' => self::QUEEN,
255 255
 			'r' => self::ROOK,
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrAccount.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	/**
247 247
 	 * Check if the account is disabled.
248 248
 	 */
249
-	public function isDisabled() : array | false {
249
+	public function isDisabled() : array|false {
250 250
 		$this->db->query('SELECT * FROM account_is_closed JOIN closing_reason USING(reason_id) ' .
251 251
 			'WHERE ' . $this->SQL . ' LIMIT 1');
252 252
 		if ($this->db->nextRecord()) {
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 			$this->db->query('SELECT type,sum(amount) as amount FROM player_hof WHERE ' . $this->SQL . ' AND game_id IN (SELECT game_id FROM game WHERE ignore_stats = \'FALSE\') GROUP BY type');
378 378
 			$this->HOF = array();
379 379
 			while ($this->db->nextRecord()) {
380
-				$hof =& $this->HOF;
380
+				$hof = & $this->HOF;
381 381
 				$typeList = explode(':', $this->db->getField('type'));
382 382
 				foreach ($typeList as $type) {
383 383
 					if (!isset($hof[$type])) {
384 384
 						$hof[$type] = array();
385 385
 					}
386
-					$hof =& $hof[$type];
386
+					$hof = & $hof[$type];
387 387
 				}
388 388
 				$hof = $this->db->getFloat('amount');
389 389
 			}
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		}
1126 1126
 	}
1127 1127
 
1128
-	public function addPoints(int $numPoints, SmrAccount $admin, int $reasonID, string $suspicion) : int | false {
1128
+	public function addPoints(int $numPoints, SmrAccount $admin, int $reasonID, string $suspicion) : int|false {
1129 1129
 		//do we have points
1130 1130
 		$this->setPoints($this->getPoints() + $numPoints, SmrSession::getTime());
1131 1131
 		$totalPoints = $this->getPoints();
Please login to merge, or discard this patch.
src/lib/Default/bar.inc.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	// Delete all tickets and re-insert the winning ticket
33 33
 	$db->query('DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($gameID));
34 34
 	$db->query('INSERT INTO player_has_ticket (game_id, account_id, time, prize) '
35
-	           .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')');
35
+			   .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')');
36 36
 
37 37
 	$db->unlock();
38 38
 
Please login to merge, or discard this patch.