We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -735,14 +735,14 @@ |
||
| 735 | 735 | |
| 736 | 736 | public function isFederal(): bool { |
| 737 | 737 | return $this->getTypeID() === SHIP_TYPE_FEDERAL_DISCOVERY || |
| 738 | - $this->getTypeID() === SHIP_TYPE_FEDERAL_WARRANT || |
|
| 739 | - $this->getTypeID() === SHIP_TYPE_FEDERAL_ULTIMATUM; |
|
| 738 | + $this->getTypeID() === SHIP_TYPE_FEDERAL_WARRANT || |
|
| 739 | + $this->getTypeID() === SHIP_TYPE_FEDERAL_ULTIMATUM; |
|
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | public function isUnderground(): bool { |
| 743 | 743 | return $this->getTypeID() === SHIP_TYPE_THIEF || |
| 744 | - $this->getTypeID() === SHIP_TYPE_ASSASSIN || |
|
| 745 | - $this->getTypeID() === SHIP_TYPE_DEATH_CRUISER; |
|
| 744 | + $this->getTypeID() === SHIP_TYPE_ASSASSIN || |
|
| 745 | + $this->getTypeID() === SHIP_TYPE_DEATH_CRUISER; |
|
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | public function shootPlayers(array $targetPlayers): array { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | return $good; |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | - return match ($xType) { |
|
| 27 | + return match($xType) { |
|
| 28 | 28 | 'Technology' => Globals::getHardwareTypes($X), |
| 29 | 29 | 'Ships' => SmrShipType::get($X), |
| 30 | 30 | 'Weapons' => SmrWeaponType::getWeaponType($X), |
@@ -279,7 +279,7 @@ |
||
| 279 | 279 | if (!isset($this->goodDistances[$goodID])) { |
| 280 | 280 | $x = Globals::getGood($goodID); |
| 281 | 281 | // Calculate distance to the opposite of the offered transaction |
| 282 | - $x['TransactionType'] = match ($this->getGoodTransaction($goodID)) { |
|
| 282 | + $x['TransactionType'] = match($this->getGoodTransaction($goodID)) { |
|
| 283 | 283 | TRADER_BUYS => TRADER_SELLS, |
| 284 | 284 | TRADER_SELLS => TRADER_BUYS, |
| 285 | 285 | }; |
@@ -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 { |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | public function getScoutMessageGroupLimit(): int { |
| 613 | - return match ($this->groupScoutMessages) { |
|
| 613 | + return match($this->groupScoutMessages) { |
|
| 614 | 614 | 'ALWAYS' => 0, |
| 615 | 615 | 'AUTO' => MESSAGES_PER_PAGE, |
| 616 | 616 | 'NEVER' => PHP_INT_MAX, |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | |
| 728 | 728 | // If expires not specified, use default based on message type |
| 729 | 729 | if ($expires === null) { |
| 730 | - $expires = match ($messageTypeID) { |
|
| 730 | + $expires = match($messageTypeID) { |
|
| 731 | 731 | MSG_GLOBAL => 3600, // 1h |
| 732 | 732 | MSG_PLAYER => 86400 * 31, // 1 month |
| 733 | 733 | MSG_PLANET => 86400 * 7, // 1 week |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | throw new Smr\Exceptions\UserError('The saved sector must be in the box!'); |
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | - $storedDestinations =& $this->getStoredDestinations(); |
|
| 1680 | + $storedDestinations = & $this->getStoredDestinations(); |
|
| 1681 | 1681 | foreach ($storedDestinations as &$sd) { |
| 1682 | 1682 | if ($sd['SectorID'] == $sectorID) { |
| 1683 | 1683 | $sd['OffsetTop'] = $offsetTop; |
@@ -1841,7 +1841,7 @@ discard block |
||
| 1841 | 1841 | public function getClaimableBounties(string $type = null): array { |
| 1842 | 1842 | $bounties = []; |
| 1843 | 1843 | $query = 'SELECT * FROM bounty WHERE claimer_id=' . $this->db->escapeNumber($this->getAccountID()) . ' AND game_id=' . $this->db->escapeNumber($this->getGameID()); |
| 1844 | - $query .= match ($type) { |
|
| 1844 | + $query .= match($type) { |
|
| 1845 | 1845 | 'HQ', 'UG' => ' AND type=' . $this->db->escapeString($type), |
| 1846 | 1846 | null => '', |
| 1847 | 1847 | }; |
@@ -2008,13 +2008,13 @@ discard block |
||
| 2008 | 2008 | $dbResult = $this->db->read('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
| 2009 | 2009 | $this->HOF = []; |
| 2010 | 2010 | foreach ($dbResult->records() as $dbRecord) { |
| 2011 | - $hof =& $this->HOF; |
|
| 2011 | + $hof = & $this->HOF; |
|
| 2012 | 2012 | $typeList = explode(':', $dbRecord->getString('type')); |
| 2013 | 2013 | foreach ($typeList as $type) { |
| 2014 | 2014 | if (!isset($hof[$type])) { |
| 2015 | 2015 | $hof[$type] = []; |
| 2016 | 2016 | } |
| 2017 | - $hof =& $hof[$type]; |
|
| 2017 | + $hof = & $hof[$type]; |
|
| 2018 | 2018 | } |
| 2019 | 2019 | $hof = $dbRecord->getFloat('amount'); |
| 2020 | 2020 | } |
@@ -2093,8 +2093,8 @@ discard block |
||
| 2093 | 2093 | } |
| 2094 | 2094 | self::$HOFVis[$hofType] = $visibility; |
| 2095 | 2095 | |
| 2096 | - $hof =& $this->HOF; |
|
| 2097 | - $hofChanged =& $this->hasHOFChanged; |
|
| 2096 | + $hof = & $this->HOF; |
|
| 2097 | + $hofChanged = & $this->hasHOFChanged; |
|
| 2098 | 2098 | $new = false; |
| 2099 | 2099 | foreach ($typeList as $type) { |
| 2100 | 2100 | if (!isset($hofChanged[$type])) { |
@@ -2104,8 +2104,8 @@ discard block |
||
| 2104 | 2104 | $hof[$type] = []; |
| 2105 | 2105 | $new = true; |
| 2106 | 2106 | } |
| 2107 | - $hof =& $hof[$type]; |
|
| 2108 | - $hofChanged =& $hofChanged[$type]; |
|
| 2107 | + $hof = & $hof[$type]; |
|
| 2108 | + $hofChanged = & $hofChanged[$type]; |
|
| 2109 | 2109 | } |
| 2110 | 2110 | if ($hofChanged == null) { |
| 2111 | 2111 | $hofChanged = self::HOF_CHANGED; |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | * Returns the CSS class color to use when displaying the player's turns |
| 2497 | 2497 | */ |
| 2498 | 2498 | public function getTurnsColor(): string { |
| 2499 | - return match ($this->getTurnsLevel()) { |
|
| 2499 | + return match($this->getTurnsLevel()) { |
|
| 2500 | 2500 | 'NONE', 'LOW' => 'red', |
| 2501 | 2501 | 'MEDIUM' => 'yellow', |
| 2502 | 2502 | 'HIGH' => 'green', |
@@ -2771,7 +2771,7 @@ discard block |
||
| 2771 | 2771 | 'Starting Sector' => $this->getSectorID(), |
| 2772 | 2772 | ]; |
| 2773 | 2773 | |
| 2774 | - $this->missions[$missionID] =& $mission; |
|
| 2774 | + $this->missions[$missionID] = & $mission; |
|
| 2775 | 2775 | $this->setupMissionStep($missionID); |
| 2776 | 2776 | $this->rebuildMission($missionID); |
| 2777 | 2777 | |
@@ -2820,7 +2820,7 @@ discard block |
||
| 2820 | 2820 | |
| 2821 | 2821 | public function claimMissionReward(int $missionID): string { |
| 2822 | 2822 | $this->getMissions(); |
| 2823 | - $mission =& $this->missions[$missionID]; |
|
| 2823 | + $mission = & $this->missions[$missionID]; |
|
| 2824 | 2824 | if ($mission === false) { |
| 2825 | 2825 | throw new Exception('Unknown mission: ' . $missionID); |
| 2826 | 2826 | } |
@@ -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', |
@@ -67,9 +67,9 @@ |
||
| 67 | 67 | $session = Session::getInstance(); |
| 68 | 68 | $account = $session->getAccount(); |
| 69 | 69 | if (($vis == HOF_PRIVATE && $account->getAccountID() != $accountID) || |
| 70 | - ($vis == HOF_ALLIANCE && isset($gameID) && |
|
| 71 | - !SmrGame::getGame($gameID)->hasEnded() && |
|
| 72 | - !SmrPlayer::getPlayer($accountID, $gameID)->sameAlliance($session->getPlayer()))) { |
|
| 70 | + ($vis == HOF_ALLIANCE && isset($gameID) && |
|
| 71 | + !SmrGame::getGame($gameID)->hasEnded() && |
|
| 72 | + !SmrPlayer::getPlayer($accountID, $gameID)->sameAlliance($session->getPlayer()))) { |
|
| 73 | 73 | return '-'; |
| 74 | 74 | } else { |
| 75 | 75 | return $amount; |