We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -76,7 +76,10 @@ discard block |
||
| 76 | 76 | <input type="number" name="amount" value="0" min="<?php echo MIN_GLOBAL_RELATIONS; ?>" max="<?php echo MAX_GLOBAL_RELATIONS; ?>" style="width:75px" /> |
| 77 | 77 | <select name="race"><?php |
| 78 | 78 | foreach (Smr\Race::getPlayableNames() as $raceID => $raceName) { |
| 79 | - if ($raceID == $ThisPlayer->getRaceID()) continue; ?> |
|
| 79 | + if ($raceID == $ThisPlayer->getRaceID()) { |
|
| 80 | + continue; |
|
| 81 | + } |
|
| 82 | + ?> |
|
| 80 | 83 | <option value="<?php echo $raceID; ?>"><?php echo $raceName; ?></option><?php |
| 81 | 84 | } ?> |
| 82 | 85 | </select> |
@@ -87,7 +90,10 @@ discard block |
||
| 87 | 90 | <form method="POST" action="<?php echo $ChangeRaceHREF; ?>"> |
| 88 | 91 | <select name="race"><?php |
| 89 | 92 | foreach (Smr\Race::getPlayableNames() as $raceID => $raceName) { |
| 90 | - if ($raceID == $ThisPlayer->getRaceID()) continue; ?> |
|
| 93 | + if ($raceID == $ThisPlayer->getRaceID()) { |
|
| 94 | + continue; |
|
| 95 | + } |
|
| 96 | + ?> |
|
| 91 | 97 | <option value="<?php echo $raceID; ?>"><?php echo $raceName; ?></option><?php |
| 92 | 98 | } ?> |
| 93 | 99 | </select> |
@@ -35,7 +35,7 @@ |
||
| 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) { |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
| 129 | 129 | ORDER BY send_time DESC'); |
| 130 | 130 | foreach ($dbResult->records() as $dbRecord) { |
| 131 | - $groupBox =& $messageBox['GroupedMessages'][$dbRecord->getInt('sender_id')]; |
|
| 131 | + $groupBox = & $messageBox['GroupedMessages'][$dbRecord->getInt('sender_id')]; |
|
| 132 | 132 | // Limit the number of messages in each group |
| 133 | 133 | if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) { |
| 134 | 134 | $groupBox['Messages'][] = displayMessage($dbRecord->getInt('message_id'), $dbRecord->getInt('account_id'), $dbRecord->getInt('sender_id'), $player->getGameID(), $dbRecord->getString('message_text'), $dbRecord->getInt('send_time'), $dbRecord->getBoolean('msg_read'), MSG_SCOUT, $player->getAccount()); |
@@ -229,13 +229,13 @@ |
||
| 229 | 229 | $planet->increaseBuilding(PLANET_HANGAR, 4); |
| 230 | 230 | $this->assertTrue($planet->hasBuilding(PLANET_HANGAR)); |
| 231 | 231 | $this->assertSame(4, $planet->getBuilding(PLANET_HANGAR)); |
| 232 | - $this->assertSame(4/3, $planet->getLevel()); |
|
| 232 | + $this->assertSame(4 / 3, $planet->getLevel()); |
|
| 233 | 233 | |
| 234 | 234 | // Destroy some hangars |
| 235 | 235 | $planet->destroyBuilding(PLANET_HANGAR, 2); |
| 236 | 236 | $this->assertTrue($planet->hasBuilding(PLANET_HANGAR)); |
| 237 | 237 | $this->assertSame(2, $planet->getBuilding(PLANET_HANGAR)); |
| 238 | - $this->assertSame(2/3, $planet->getLevel()); |
|
| 238 | + $this->assertSame(2 / 3, $planet->getLevel()); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | public function test_defenses() : void { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // Send vote announcement to members of the player's council (war votes) |
| 45 | 45 | // or both races' councils (peace votes). |
| 46 | 46 | $councilMembers = Council::getRaceCouncil($player->getGameID(), |
| 47 | - $player->getRaceID()); |
|
| 47 | + $player->getRaceID()); |
|
| 48 | 48 | if ($type == 'PEACE') { |
| 49 | 49 | $otherCouncil = Council::getRaceCouncil($player->getGameID(), $race_id); |
| 50 | 50 | $councilMembers = array_merge($councilMembers, $otherCouncil); |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | $color = ($type == 'PEACE' ? 'dgreen' : 'red'); |
| 55 | 55 | $type_fancy = "<span class=\"$color\">$type</span>"; |
| 56 | 56 | $message = $player->getLevelName() . " " . $player->getBBLink() |
| 57 | - . " has initiated a vote for $type_fancy with the [race=$race_id]!" |
|
| 58 | - . " You have " . format_time(TIME_FOR_COUNCIL_VOTE) |
|
| 59 | - . " to cast your vote."; |
|
| 57 | + . " has initiated a vote for $type_fancy with the [race=$race_id]!" |
|
| 58 | + . " You have " . format_time(TIME_FOR_COUNCIL_VOTE) |
|
| 59 | + . " to cast your vote."; |
|
| 60 | 60 | |
| 61 | 61 | foreach ($councilMembers as $accountID) { |
| 62 | 62 | // don't send to the player who started the vote |
| 63 | 63 | if ($player->getAccountID() != $accountID) { |
| 64 | 64 | SmrPlayer::sendMessageFromRace($player->getRaceID(), $player->getGameID(), |
| 65 | - $accountID, $message, $time); |
|
| 65 | + $accountID, $message, $time); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -1678,7 +1678,7 @@ discard block |
||
| 1678 | 1678 | throw new Smr\Exceptions\UserError('The saved sector must be in the box!'); |
| 1679 | 1679 | } |
| 1680 | 1680 | |
| 1681 | - $storedDestinations =& $this->getStoredDestinations(); |
|
| 1681 | + $storedDestinations = & $this->getStoredDestinations(); |
|
| 1682 | 1682 | foreach ($storedDestinations as &$sd) { |
| 1683 | 1683 | if ($sd['SectorID'] == $sectorID) { |
| 1684 | 1684 | $sd['OffsetTop'] = $offsetTop; |
@@ -2005,13 +2005,13 @@ discard block |
||
| 2005 | 2005 | $dbResult = $this->db->read('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
| 2006 | 2006 | $this->HOF = array(); |
| 2007 | 2007 | foreach ($dbResult->records() as $dbRecord) { |
| 2008 | - $hof =& $this->HOF; |
|
| 2008 | + $hof = & $this->HOF; |
|
| 2009 | 2009 | $typeList = explode(':', $dbRecord->getString('type')); |
| 2010 | 2010 | foreach ($typeList as $type) { |
| 2011 | 2011 | if (!isset($hof[$type])) { |
| 2012 | 2012 | $hof[$type] = array(); |
| 2013 | 2013 | } |
| 2014 | - $hof =& $hof[$type]; |
|
| 2014 | + $hof = & $hof[$type]; |
|
| 2015 | 2015 | } |
| 2016 | 2016 | $hof = $dbRecord->getFloat('amount'); |
| 2017 | 2017 | } |
@@ -2090,8 +2090,8 @@ discard block |
||
| 2090 | 2090 | } |
| 2091 | 2091 | self::$HOFVis[$hofType] = $visibility; |
| 2092 | 2092 | |
| 2093 | - $hof =& $this->HOF; |
|
| 2094 | - $hofChanged =& $this->hasHOFChanged; |
|
| 2093 | + $hof = & $this->HOF; |
|
| 2094 | + $hofChanged = & $this->hasHOFChanged; |
|
| 2095 | 2095 | $new = false; |
| 2096 | 2096 | foreach ($typeList as $type) { |
| 2097 | 2097 | if (!isset($hofChanged[$type])) { |
@@ -2101,8 +2101,8 @@ discard block |
||
| 2101 | 2101 | $hof[$type] = array(); |
| 2102 | 2102 | $new = true; |
| 2103 | 2103 | } |
| 2104 | - $hof =& $hof[$type]; |
|
| 2105 | - $hofChanged =& $hofChanged[$type]; |
|
| 2104 | + $hof = & $hof[$type]; |
|
| 2105 | + $hofChanged = & $hofChanged[$type]; |
|
| 2106 | 2106 | } |
| 2107 | 2107 | if ($hofChanged == null) { |
| 2108 | 2108 | $hofChanged = self::HOF_CHANGED; |
@@ -2741,7 +2741,7 @@ discard block |
||
| 2741 | 2741 | 'Starting Sector' => $this->getSectorID() |
| 2742 | 2742 | ); |
| 2743 | 2743 | |
| 2744 | - $this->missions[$missionID] =& $mission; |
|
| 2744 | + $this->missions[$missionID] = & $mission; |
|
| 2745 | 2745 | $this->setupMissionStep($missionID); |
| 2746 | 2746 | $this->rebuildMission($missionID); |
| 2747 | 2747 | |
@@ -2791,7 +2791,7 @@ discard block |
||
| 2791 | 2791 | |
| 2792 | 2792 | public function claimMissionReward(int $missionID) : string { |
| 2793 | 2793 | $this->getMissions(); |
| 2794 | - $mission =& $this->missions[$missionID]; |
|
| 2794 | + $mission = & $this->missions[$missionID]; |
|
| 2795 | 2795 | if ($mission === false) { |
| 2796 | 2796 | throw new Exception('Unknown mission: ' . $missionID); |
| 2797 | 2797 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | foreach ($dbResult->records() as $dbRecord) { |
| 310 | 310 | try { |
| 311 | 311 | $otherPlayer = SmrPlayer::getPlayer($dbRecord->getInt('from_account_id'), |
| 312 | - $this->getGameID(), $forceUpdate); |
|
| 312 | + $this->getGameID(), $forceUpdate); |
|
| 313 | 313 | } catch (Smr\Exceptions\PlayerNotFound) { |
| 314 | 314 | // Skip players that have not joined this game |
| 315 | 315 | continue; |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | */ |
| 867 | 867 | public function canFight() : bool { |
| 868 | 868 | return !($this->hasNewbieTurns() || |
| 869 | - $this->isDead() || |
|
| 870 | - $this->isLandedOnPlanet() || |
|
| 871 | - $this->hasFederalProtection()); |
|
| 869 | + $this->isDead() || |
|
| 870 | + $this->isLandedOnPlanet() || |
|
| 871 | + $this->hasFederalProtection()); |
|
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | public function setDead(bool $bool) : void { |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class VoteSite { |
| 11 | 11 | |
| 12 | - private static ?array $CACHE_TIMEOUTS = null; |
|
| 12 | + private static ? array $CACHE_TIMEOUTS = null; |
|
| 13 | 13 | |
| 14 | 14 | // NOTE: link IDs should never be changed! |
| 15 | 15 | const LINK_ID_TWG = 3; |
@@ -44,7 +44,10 @@ |
||
| 44 | 44 | <td> |
| 45 | 45 | <select name="game_type"><?php |
| 46 | 46 | foreach (SmrGame::GAME_TYPES as $GameTypeID => $GameType) { |
| 47 | - ?><option value="<?php echo $GameTypeID; ?>" <?php if ($GameType == $Game['gameType']) echo 'selected'; ?>><?php echo $GameType; ?></option><?php |
|
| 47 | + ?><option value="<?php echo $GameTypeID; ?>" <?php if ($GameType == $Game['gameType']) { |
|
| 48 | + echo 'selected'; |
|
| 49 | + } |
|
| 50 | + ?>><?php echo $GameType; ?></option><?php |
|
| 48 | 51 | } ?> |
| 49 | 52 | </select> |
| 50 | 53 | </td> |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | </center><?php |
| 75 | 75 | |
| 76 | 76 | } elseif (in_array($type, ['search', 'alliance_ips', 'wild_log', 'wild_in', |
| 77 | - 'compare', 'compare_log', 'wild_ip', 'wild_host'])) { ?> |
|
| 77 | + 'compare', 'compare_log', 'wild_ip', 'wild_host'])) { ?> |
|
| 78 | 78 | |
| 79 | 79 | <center> |
| 80 | 80 | <?php echo $Summary; ?><br /><br /> |