We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -870,9 +870,9 @@ |
||
| 870 | 870 | */ |
| 871 | 871 | public function canFight(): bool { |
| 872 | 872 | return !($this->hasNewbieTurns() || |
| 873 | - $this->isDead() || |
|
| 874 | - $this->isLandedOnPlanet() || |
|
| 875 | - $this->hasFederalProtection()); |
|
| 873 | + $this->isDead() || |
|
| 874 | + $this->isLandedOnPlanet() || |
|
| 875 | + $this->hasFederalProtection()); |
|
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | public function setDead(bool $bool): void { |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | public function getScoutMessageGroupLimit(): int { |
| 612 | - return match ($this->groupScoutMessages) { |
|
| 612 | + return match($this->groupScoutMessages) { |
|
| 613 | 613 | 'ALWAYS' => 0, |
| 614 | 614 | 'AUTO' => MESSAGES_PER_PAGE, |
| 615 | 615 | 'NEVER' => PHP_INT_MAX, |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | |
| 727 | 727 | // If expires not specified, use default based on message type |
| 728 | 728 | if ($expires === null) { |
| 729 | - $expires = match ($messageTypeID) { |
|
| 729 | + $expires = match($messageTypeID) { |
|
| 730 | 730 | MSG_GLOBAL => 3600, // 1h |
| 731 | 731 | MSG_PLAYER => 86400 * 31, // 1 month |
| 732 | 732 | MSG_PLANET => 86400 * 7, // 1 week |
@@ -1838,7 +1838,7 @@ discard block |
||
| 1838 | 1838 | public function getClaimableBounties(string $type = null): array { |
| 1839 | 1839 | $bounties = []; |
| 1840 | 1840 | $query = 'SELECT * FROM bounty WHERE claimer_id=' . $this->db->escapeNumber($this->getAccountID()) . ' AND game_id=' . $this->db->escapeNumber($this->getGameID()); |
| 1841 | - $query .= match ($type) { |
|
| 1841 | + $query .= match($type) { |
|
| 1842 | 1842 | 'HQ', 'UG' => ' AND type=' . $this->db->escapeString($type), |
| 1843 | 1843 | null => '', |
| 1844 | 1844 | }; |
@@ -2003,13 +2003,13 @@ discard block |
||
| 2003 | 2003 | $dbResult = $this->db->read('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
| 2004 | 2004 | $this->HOF = []; |
| 2005 | 2005 | foreach ($dbResult->records() as $dbRecord) { |
| 2006 | - $hof =& $this->HOF; |
|
| 2006 | + $hof = & $this->HOF; |
|
| 2007 | 2007 | $typeList = explode(':', $dbRecord->getString('type')); |
| 2008 | 2008 | foreach ($typeList as $type) { |
| 2009 | 2009 | if (!isset($hof[$type])) { |
| 2010 | 2010 | $hof[$type] = []; |
| 2011 | 2011 | } |
| 2012 | - $hof =& $hof[$type]; |
|
| 2012 | + $hof = & $hof[$type]; |
|
| 2013 | 2013 | } |
| 2014 | 2014 | $hof = $dbRecord->getFloat('amount'); |
| 2015 | 2015 | } |
@@ -2088,8 +2088,8 @@ discard block |
||
| 2088 | 2088 | } |
| 2089 | 2089 | self::$HOFVis[$hofType] = $visibility; |
| 2090 | 2090 | |
| 2091 | - $hof =& $this->HOF; |
|
| 2092 | - $hofChanged =& $this->hasHOFChanged; |
|
| 2091 | + $hof = & $this->HOF; |
|
| 2092 | + $hofChanged = & $this->hasHOFChanged; |
|
| 2093 | 2093 | $new = false; |
| 2094 | 2094 | foreach ($typeList as $type) { |
| 2095 | 2095 | if (!isset($hofChanged[$type])) { |
@@ -2099,8 +2099,8 @@ discard block |
||
| 2099 | 2099 | $hof[$type] = []; |
| 2100 | 2100 | $new = true; |
| 2101 | 2101 | } |
| 2102 | - $hof =& $hof[$type]; |
|
| 2103 | - $hofChanged =& $hofChanged[$type]; |
|
| 2102 | + $hof = & $hof[$type]; |
|
| 2103 | + $hofChanged = & $hofChanged[$type]; |
|
| 2104 | 2104 | } |
| 2105 | 2105 | if ($hofChanged == null) { |
| 2106 | 2106 | $hofChanged = self::HOF_CHANGED; |
@@ -2491,7 +2491,7 @@ discard block |
||
| 2491 | 2491 | * Returns the CSS class color to use when displaying the player's turns |
| 2492 | 2492 | */ |
| 2493 | 2493 | public function getTurnsColor(): string { |
| 2494 | - return match ($this->getTurnsLevel()) { |
|
| 2494 | + return match($this->getTurnsLevel()) { |
|
| 2495 | 2495 | 'NONE', 'LOW' => 'red', |
| 2496 | 2496 | 'MEDIUM' => 'yellow', |
| 2497 | 2497 | 'HIGH' => 'green', |
@@ -2766,7 +2766,7 @@ discard block |
||
| 2766 | 2766 | 'Starting Sector' => $this->getSectorID(), |
| 2767 | 2767 | ]; |
| 2768 | 2768 | |
| 2769 | - $this->missions[$missionID] =& $mission; |
|
| 2769 | + $this->missions[$missionID] = & $mission; |
|
| 2770 | 2770 | $this->setupMissionStep($missionID); |
| 2771 | 2771 | $this->rebuildMission($missionID); |
| 2772 | 2772 | |
@@ -2815,7 +2815,7 @@ discard block |
||
| 2815 | 2815 | |
| 2816 | 2816 | public function claimMissionReward(int $missionID): string { |
| 2817 | 2817 | $this->getMissions(); |
| 2818 | - $mission =& $this->missions[$missionID]; |
|
| 2818 | + $mission = & $this->missions[$missionID]; |
|
| 2819 | 2819 | if ($mission === false) { |
| 2820 | 2820 | throw new Exception('Unknown mission: ' . $missionID); |
| 2821 | 2821 | } |
@@ -393,13 +393,13 @@ |
||
| 393 | 393 | $dbResult = $this->db->read('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'); |
| 394 | 394 | $this->HOF = []; |
| 395 | 395 | foreach ($dbResult->records() as $dbRecord) { |
| 396 | - $hof =& $this->HOF; |
|
| 396 | + $hof = & $this->HOF; |
|
| 397 | 397 | $typeList = explode(':', $dbRecord->getString('type')); |
| 398 | 398 | foreach ($typeList as $type) { |
| 399 | 399 | if (!isset($hof[$type])) { |
| 400 | 400 | $hof[$type] = []; |
| 401 | 401 | } |
| 402 | - $hof =& $hof[$type]; |
|
| 402 | + $hof = & $hof[$type]; |
|
| 403 | 403 | } |
| 404 | 404 | $hof = $dbRecord->getFloat('amount'); |
| 405 | 405 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * Not intended to be used outside the DI context. |
| 27 | 27 | */ |
| 28 | 28 | public static function mysqliFactory(DatabaseProperties $dbProperties): mysqli { |
| 29 | - if (!mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT)) { |
|
| 29 | + if (!mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT)) { |
|
| 30 | 30 | throw new RuntimeException('Failed to enable mysqli error reporting'); |
| 31 | 31 | } |
| 32 | 32 | $mysql = new mysqli( |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public function escape(mixed $escape): mixed { |
| 171 | - return match (true) { |
|
| 171 | + return match(true) { |
|
| 172 | 172 | is_bool($escape) => $this->escapeBoolean($escape), |
| 173 | 173 | is_numeric($escape) => $this->escapeNumber($escape), |
| 174 | 174 | is_string($escape) => $this->escapeString($escape), |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | if (!empty($accountID)) { |
| 60 | 60 | $return = SmrPlayer::getPlayer($accountID, $gameID); |
| 61 | 61 | } else { |
| 62 | - $return = match ($messageType) { |
|
| 62 | + $return = match($messageType) { |
|
| 63 | 63 | MSG_ADMIN => '<span class="admin">Administrator</span>', |
| 64 | 64 | MSG_ALLIANCE => '<span class="green">Alliance Ambassador</span>', |
| 65 | 65 | default => 'Unknown', |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * Return the card's blackjack value. |
| 36 | 36 | */ |
| 37 | 37 | public function getValue(): int { |
| 38 | - return match ($this->rank) { |
|
| 38 | + return match($this->rank) { |
|
| 39 | 39 | self::RANK_ACE => 11, |
| 40 | 40 | self::RANK_JACK, self::RANK_QUEEN, self::RANK_KING => 10, |
| 41 | 41 | // For normal pip (non-face) cards, value and rank are the same. |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Returns the rank name of this card (of the 13 ranks). |
| 58 | 58 | */ |
| 59 | 59 | public function getRankName(): string { |
| 60 | - return match ($this->rank) { |
|
| 60 | + return match($this->rank) { |
|
| 61 | 61 | self::RANK_ACE => 'A', |
| 62 | 62 | self::RANK_JACK => 'J', |
| 63 | 63 | self::RANK_QUEEN => 'Q', |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | public static function getLetterForPiece(int $pieceID, string $colour): string { |
| 211 | - $letter = match ($pieceID) { |
|
| 211 | + $letter = match($pieceID) { |
|
| 212 | 212 | self::KING => 'k', |
| 213 | 213 | self::QUEEN => 'q', |
| 214 | 214 | self::ROOK => 'r', |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | public static function getPieceForLetter(string $letter): int { |
| 226 | - return match (strtolower($letter)) { |
|
| 226 | + return match(strtolower($letter)) { |
|
| 227 | 227 | 'k' => self::KING, |
| 228 | 228 | 'q' => self::QUEEN, |
| 229 | 229 | 'r' => self::ROOK, |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $blanks = 0; |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | - $fen .= match ($this->getCurrentTurnColour()) { |
|
| 269 | + $fen .= match($this->getCurrentTurnColour()) { |
|
| 270 | 270 | self::PLAYER_WHITE => ' w ', |
| 271 | 271 | self::PLAYER_BLACK => ' b ', |
| 272 | 272 | }; |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | |
| 297 | 297 | if ($this->hasMoved[ChessPiece::PAWN][0] != -1) { |
| 298 | 298 | $fen .= chr(ord('a') + $this->hasMoved[ChessPiece::PAWN][0]); |
| 299 | - $fen .= match ($this->hasMoved[ChessPiece::PAWN][1]) { |
|
| 299 | + $fen .= match($this->hasMoved[ChessPiece::PAWN][1]) { |
|
| 300 | 300 | 3 => '6', |
| 301 | 301 | 4 => '3', |
| 302 | 302 | }; |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | public static function isCastling(int $x, int $toX): array|false { |
| 466 | 466 | $movement = $toX - $x; |
| 467 | - return match ($movement) { |
|
| 467 | + return match($movement) { |
|
| 468 | 468 | -2 => ['Type' => 'Queen', 'X' => 0, 'ToX' => 3], |
| 469 | 469 | 2 => ['Type' => 'King', 'X' => 7, 'ToX' => 5], |
| 470 | 470 | default => false, |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | public function getColourID(string $colour): int { |
| 775 | - return match ($colour) { |
|
| 775 | + return match($colour) { |
|
| 776 | 776 | self::PLAYER_WHITE => $this->getWhiteID(), |
| 777 | 777 | self::PLAYER_BLACK => $this->getBlackID(), |
| 778 | 778 | }; |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | public function getColourForAccountID(int $accountID): string { |
| 786 | - return match ($accountID) { |
|
| 786 | + return match($accountID) { |
|
| 787 | 787 | $this->getWhiteID() => self::PLAYER_WHITE, |
| 788 | 788 | $this->getBlackID() => self::PLAYER_BLACK, |
| 789 | 789 | }; |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | public static function getOtherColour(string $colour): string { |
| 863 | - return match ($colour) { |
|
| 863 | + return match($colour) { |
|
| 864 | 864 | self::PLAYER_WHITE => self::PLAYER_BLACK, |
| 865 | 865 | self::PLAYER_BLACK => self::PLAYER_WHITE, |
| 866 | 866 | }; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | class VoteSite { |
| 12 | 12 | |
| 13 | - private static ?array $CACHE_TIMEOUTS = null; |
|
| 13 | + private static ? array $CACHE_TIMEOUTS = null; |
|
| 14 | 14 | |
| 15 | 15 | // NOTE: link IDs should never be changed! |
| 16 | 16 | public const LINK_ID_TWG = 3; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | private static function getSiteData(int $linkID): array { |
| 32 | 32 | // This can't be a static/constant attribute due to `url_func` closures. |
| 33 | - return match ($linkID) { |
|
| 33 | + return match($linkID) { |
|
| 34 | 34 | self::LINK_ID_TWG => [ |
| 35 | 35 | 'img_default' => 'twg.png', |
| 36 | 36 | 'img_star' => 'twg_vote.png', |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function getBoolean(string $name): bool { |
| 31 | - return match ($this->dbRecord[$name]) { |
|
| 31 | + return match($this->dbRecord[$name]) { |
|
| 32 | 32 | 'TRUE' => true, |
| 33 | 33 | 'FALSE' => false, |
| 34 | 34 | }; |