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 (#1005)
by Dan
04:25
created
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.
src/lib/Default/DummyShip.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	protected function doFullUNO() {
19
-		foreach($this->getMaxHardware() as $hardwareTypeID => $max) {
19
+		foreach ($this->getMaxHardware() as $hardwareTypeID => $max) {
20 20
 			$this->hardware[$hardwareTypeID] = $max;
21 21
 			$this->oldHardware[$hardwareTypeID] = $max;
22 22
 		}
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	public function getIllusionShip() {
49
-		if(!isset($this->illusionShip)) {
50
-			$this->illusionShip=false;
49
+		if (!isset($this->illusionShip)) {
50
+			$this->illusionShip = false;
51 51
 		}
52 52
 		return $this->illusionShip;
53 53
 	}
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
 		$db = MySqlDatabase::getInstance();
58 58
 		$db->query('REPLACE INTO cached_dummys ' .
59 59
 					'(type, id, info) ' .
60
-					'VALUES (\'DummyShip\', '.$db->escapeString($this->getPlayer()->getPlayerName()).', '.$db->escapeString($cache).')');
60
+					'VALUES (\'DummyShip\', ' . $db->escapeString($this->getPlayer()->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');
61 61
 		unserialize($cache);
62 62
 	}
63 63
 
64 64
 	public static function getCachedDummyShip(AbstractSmrPlayer $player) {
65
-		if(!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
65
+		if (!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
66 66
 			$db = MySqlDatabase::getInstance();
67 67
 			$db->query('SELECT info FROM cached_dummys
68 68
 						WHERE type = \'DummyShip\'
69 69
 						AND id = ' . $db->escapeString($player->getPlayerName()) . ' LIMIT 1');
70
-			if($db->nextRecord()) {
70
+			if ($db->nextRecord()) {
71 71
 				$return = unserialize($db->getField('info'));
72 72
 				$return->regenerate($player);
73
-				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] =& $return;
73
+				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = & $return;
74 74
 			} else {
75 75
 				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = new DummyShip($player);
76 76
 			}
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$db->query('SELECT id FROM cached_dummys
84 84
 					WHERE type = \'DummyShip\'');
85 85
 		$dummyNames = array();
86
-		while($db->nextRecord()) {
86
+		while ($db->nextRecord()) {
87 87
 			$dummyNames[] = $db->getField('id');
88 88
 		}
89 89
 		return $dummyNames;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	public function __sleep() {
95
-		return array('gameID','weapons');
95
+		return array('gameID', 'weapons');
96 96
 	}
97 97
 
98 98
 	public function __wakeup() {
Please login to merge, or discard this patch.
src/lib/Default/SmrMines.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,12 +121,12 @@
 block discarded – undo
121 121
 	}
122 122
 
123 123
 	protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer, $minesAreAttacker = false) {
124
-		$return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker);
125
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']);
124
+		$return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker);
125
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']);
126 126
 		$return['ActualDamage']['Launched'] = ICeil($return['WeaponDamage']['Launched'] * $return['ActualDamage']['TotalDamage'] / $return['WeaponDamage']['MaxDamage']);
127 127
 
128 128
 		if ($return['ActualDamage']['KillingShot']) {
129
-			$return['KillResults'] =& $targetPlayer->killPlayerByForces($forces);
129
+			$return['KillResults'] = & $targetPlayer->killPlayerByForces($forces);
130 130
 		}
131 131
 		return $return;
132 132
 	}
Please login to merge, or discard this patch.