We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -234,7 +234,7 @@ discard block |
||
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 |
||
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, |
@@ -246,7 +246,7 @@ discard block |
||
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 |
||
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 |
||
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(); |
@@ -16,7 +16,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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() { |
@@ -121,12 +121,12 @@ |
||
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 | } |