We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -707,7 +707,7 @@ |
||
| 707 | 707 | if ($buildingTypeID === false) { |
| 708 | 708 | $structs = $this->typeInfo::STRUCTURES; |
| 709 | 709 | return array_combine(array_keys($structs), |
| 710 | - array_column($structs, 'max_amount')); |
|
| 710 | + array_column($structs, 'max_amount')); |
|
| 711 | 711 | } |
| 712 | 712 | return $this->getStructureTypes($buildingTypeID)->maxAmount(); |
| 713 | 713 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | $results['DeadBeforeShot'] = false; |
| 1167 | 1167 | $weapons = $this->getWeapons(); |
| 1168 | 1168 | foreach ($weapons as $orderID => $weapon) { |
| 1169 | - $results['Weapons'][$orderID] =& $weapon->shootPlayerAsPlanet($this, array_rand_value($targetPlayers)); |
|
| 1169 | + $results['Weapons'][$orderID] = & $weapon->shootPlayerAsPlanet($this, array_rand_value($targetPlayers)); |
|
| 1170 | 1170 | if ($results['Weapons'][$orderID]['Hit']) { |
| 1171 | 1171 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 1172 | 1172 | $results['TotalDamagePerTargetPlayer'][$results['Weapons'][$orderID]['TargetPlayer']->getAccountID()] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
@@ -1174,7 +1174,7 @@ discard block |
||
| 1174 | 1174 | } |
| 1175 | 1175 | if ($this->hasCDs()) { |
| 1176 | 1176 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true); |
| 1177 | - $results['Drones'] =& $thisCDs->shootPlayerAsPlanet($this, array_rand_value($targetPlayers)); |
|
| 1177 | + $results['Drones'] = & $thisCDs->shootPlayerAsPlanet($this, array_rand_value($targetPlayers)); |
|
| 1178 | 1178 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1179 | 1179 | $results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1180 | 1180 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public static function mysqliFactory(MySqlProperties $mysqlProperties): mysqli { |
| 41 | - if (!mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT)) { |
|
| 41 | + if (!mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT)) { |
|
| 42 | 42 | throw new RuntimeException('Failed to enable mysqli error reporting'); |
| 43 | 43 | } |
| 44 | 44 | $mysql = new mysqli( |
@@ -549,7 +549,7 @@ |
||
| 549 | 549 | */ |
| 550 | 550 | public function setWarp(SmrSector $warp) { |
| 551 | 551 | if ($this->getWarp() == $warp->getSectorID() && |
| 552 | - $warp->getWarp() == $this->getSectorID()) { |
|
| 552 | + $warp->getWarp() == $this->getSectorID()) { |
|
| 553 | 553 | // Warps are already set correctly! |
| 554 | 554 | return; |
| 555 | 555 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $this->cargo_left = $this->getCargoHolds(); |
| 18 | 18 | } |
| 19 | 19 | protected function doFullUNO() { |
| 20 | - foreach($this->getMaxHardware() as $hardwareTypeID => $max) { |
|
| 20 | + foreach ($this->getMaxHardware() as $hardwareTypeID => $max) { |
|
| 21 | 21 | $this->hardware[$hardwareTypeID] = $max; |
| 22 | 22 | $this->oldHardware[$hardwareTypeID] = $max; |
| 23 | 23 | } |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function getIllusionShip() { |
| 50 | - if(!isset($this->illusionShip)) { |
|
| 51 | - $this->illusionShip=false; |
|
| 50 | + if (!isset($this->illusionShip)) { |
|
| 51 | + $this->illusionShip = false; |
|
| 52 | 52 | } |
| 53 | 53 | return $this->illusionShip; |
| 54 | 54 | } |
@@ -58,20 +58,20 @@ discard block |
||
| 58 | 58 | $db = MySqlDatabase::getInstance(); |
| 59 | 59 | $db->query('REPLACE INTO cached_dummys ' . |
| 60 | 60 | '(type, id, info) ' . |
| 61 | - 'VALUES (\'DummyShip\', '.$db->escapeString($this->getPlayer()->getPlayerName()).', '.$db->escapeString($cache).')'); |
|
| 61 | + 'VALUES (\'DummyShip\', ' . $db->escapeString($this->getPlayer()->getPlayerName()) . ', ' . $db->escapeString($cache) . ')'); |
|
| 62 | 62 | unserialize($cache); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public static function getCachedDummyShip(AbstractSmrPlayer $player) { |
| 66 | - if(!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) { |
|
| 66 | + if (!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) { |
|
| 67 | 67 | $db = MySqlDatabase::getInstance(); |
| 68 | 68 | $db->query('SELECT info FROM cached_dummys |
| 69 | 69 | WHERE type = \'DummyShip\' |
| 70 | 70 | AND id = ' . $db->escapeString($player->getPlayerName()) . ' LIMIT 1'); |
| 71 | - if($db->nextRecord()) { |
|
| 71 | + if ($db->nextRecord()) { |
|
| 72 | 72 | $return = unserialize($db->getField('info')); |
| 73 | 73 | $return->regenerate($player); |
| 74 | - self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] =& $return; |
|
| 74 | + self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = & $return; |
|
| 75 | 75 | } else { |
| 76 | 76 | self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = new DummyShip($player); |
| 77 | 77 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $db->query('SELECT id FROM cached_dummys |
| 85 | 85 | WHERE type = \'DummyShip\''); |
| 86 | 86 | $dummyNames = array(); |
| 87 | - while($db->nextRecord()) { |
|
| 87 | + while ($db->nextRecord()) { |
|
| 88 | 88 | $dummyNames[] = $db->getField('id'); |
| 89 | 89 | } |
| 90 | 90 | return $dummyNames; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | public function __sleep() { |
| 96 | - return array('gameID','weapons'); |
|
| 96 | + return array('gameID', 'weapons'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function __wakeup() { |
@@ -1,30 +1,30 @@ discard block |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | |
| 3 | 3 | class DummyPlayer extends AbstractSmrPlayer { |
| 4 | - public function __construct($gameID=0,$playerName='Dummy',$raceID=1,$experience=1000,$alignment=100,$allianceID=0,$shipTypeID=60) { |
|
| 4 | + public function __construct($gameID = 0, $playerName = 'Dummy', $raceID = 1, $experience = 1000, $alignment = 100, $allianceID = 0, $shipTypeID = 60) { |
|
| 5 | 5 | $this->accountID = 0; |
| 6 | - $this->gameID = (int) $gameID; |
|
| 7 | - $this->playerName = (string) $playerName; |
|
| 6 | + $this->gameID = (int)$gameID; |
|
| 7 | + $this->playerName = (string)$playerName; |
|
| 8 | 8 | $this->playerID = 0; |
| 9 | 9 | $this->sectorID = 0; |
| 10 | - $this->lastSectorID = 0; |
|
| 10 | + $this->lastSectorID = 0; |
|
| 11 | 11 | $this->turns = 1000; |
| 12 | - $this->newbieTurns = 0; |
|
| 12 | + $this->newbieTurns = 0; |
|
| 13 | 13 | $this->lastNewsUpdate = 0; |
| 14 | 14 | $this->dead = false; |
| 15 | 15 | $this->landedOnPlanet = false; |
| 16 | - $this->lastActive = 0; |
|
| 17 | - $this->lastCPLAction = 0; |
|
| 18 | - $this->raceID = (int) $raceID; |
|
| 19 | - $this->credits = 0; |
|
| 20 | - $this->experience = (int) $experience; |
|
| 21 | - $this->alignment = (int) $alignment; |
|
| 22 | - $this->militaryPayment = 0; |
|
| 23 | - $this->allianceID = (int) $allianceID; |
|
| 24 | - $this->shipID = (int) $shipTypeID; |
|
| 16 | + $this->lastActive = 0; |
|
| 17 | + $this->lastCPLAction = 0; |
|
| 18 | + $this->raceID = (int)$raceID; |
|
| 19 | + $this->credits = 0; |
|
| 20 | + $this->experience = (int)$experience; |
|
| 21 | + $this->alignment = (int)$alignment; |
|
| 22 | + $this->militaryPayment = 0; |
|
| 23 | + $this->allianceID = (int)$allianceID; |
|
| 24 | + $this->shipID = (int)$shipTypeID; |
|
| 25 | 25 | $this->kills = 0; |
| 26 | 26 | $this->deaths = 0; |
| 27 | - $this->lastPort = 0; |
|
| 27 | + $this->lastPort = 0; |
|
| 28 | 28 | $this->bank = 0; |
| 29 | 29 | $this->zoom = 0; |
| 30 | 30 | |
@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function setAllianceID($ID) { |
| 51 | - if($this->allianceID == $ID) |
|
| 51 | + if ($this->allianceID == $ID) |
|
| 52 | 52 | return; |
| 53 | - $this->allianceID=$ID; |
|
| 53 | + $this->allianceID = $ID; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function &killPlayerByPlayer(AbstractSmrPlayer $killer) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $db = MySqlDatabase::getInstance(); |
| 77 | 77 | $db->query('REPLACE INTO cached_dummys ' . |
| 78 | 78 | '(type, id, info) ' . |
| 79 | - 'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')'); |
|
| 79 | + 'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')'); |
|
| 80 | 80 | unserialize($cache); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $db->query('SELECT info FROM cached_dummys |
| 86 | 86 | WHERE type = \'DummyPlayer\' |
| 87 | 87 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
| 88 | - if($db->nextRecord()) { |
|
| 88 | + if ($db->nextRecord()) { |
|
| 89 | 89 | $return = unserialize($db->getField('info')); |
| 90 | 90 | return $return; |
| 91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $db->query('SELECT id FROM cached_dummys |
| 101 | 101 | WHERE type = \'DummyPlayer\''); |
| 102 | 102 | $dummyNames = array(); |
| 103 | - while($db->nextRecord()) { |
|
| 103 | + while ($db->nextRecord()) { |
|
| 104 | 104 | $dummyNames[] = $db->getField('id'); |
| 105 | 105 | } |
| 106 | 106 | return $dummyNames; |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function setAllianceID($ID) { |
| 56 | - if($this->allianceID == $ID) |
|
| 57 | - return; |
|
| 56 | + if($this->allianceID == $ID) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 58 | 59 | $this->allianceID=$ID; |
| 59 | 60 | } |
| 60 | 61 | |
@@ -93,8 +94,7 @@ discard block |
||
| 93 | 94 | if($db->nextRecord()) { |
| 94 | 95 | $return = unserialize($db->getField('info')); |
| 95 | 96 | return $return; |
| 96 | - } |
|
| 97 | - else { |
|
| 97 | + } else { |
|
| 98 | 98 | $return = new DummyPlayer(); |
| 99 | 99 | return $return; |
| 100 | 100 | } |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | if (!empty(BUG_REPORT_TO_ADDRESSES)) { |
| 70 | 70 | $mail = setupMailer(); |
| 71 | 71 | $mail->Subject = (defined('PAGE_PREFIX') ? PAGE_PREFIX : '??? ') . |
| 72 | - 'Automatic Bug Report'; |
|
| 72 | + 'Automatic Bug Report'; |
|
| 73 | 73 | $mail->setFrom('[email protected]'); |
| 74 | 74 | $mail->Body = $message; |
| 75 | 75 | foreach (BUG_REPORT_TO_ADDRESSES as $toAddress) { |
@@ -3,10 +3,10 @@ |
||
| 3 | 3 | // Holds information linking the received message and the game data |
| 4 | 4 | class GameLink |
| 5 | 5 | { |
| 6 | - public $valid = false; // identifies if the message is linked to game data |
|
| 7 | - public $account; // SmrAccount instance |
|
| 8 | - public $alliance; // SmrAlliance instance |
|
| 9 | - public $player; // SmrPlayer instance |
|
| 6 | + public $valid = false; // identifies if the message is linked to game data |
|
| 7 | + public $account; // SmrAccount instance |
|
| 8 | + public $alliance; // SmrAlliance instance |
|
| 9 | + public $player; // SmrPlayer instance |
|
| 10 | 10 | |
| 11 | 11 | // $author can be either Discord\Parts\User\{User,Member} |
| 12 | 12 | function __construct(Discord\Parts\Channel\Channel $channel, $author) { |
@@ -20,11 +20,11 @@ |
||
| 20 | 20 | $this->includeTemplate('includes/ForceFullCombatResults.inc.php', array('FullForceCombatResults'=>$CombatResults)); |
| 21 | 21 | } elseif ($CombatResultsType == 'PORT') { |
| 22 | 22 | $this->includeTemplate('includes/PortFullCombatResults.inc.php', array('FullPortCombatResults'=>$CombatResults, |
| 23 | - 'MinimalDisplay'=>false, |
|
| 24 | - 'AlreadyDestroyed'=>false)); |
|
| 23 | + 'MinimalDisplay'=>false, |
|
| 24 | + 'AlreadyDestroyed'=>false)); |
|
| 25 | 25 | } elseif ($CombatResultsType == 'PLANET') { |
| 26 | 26 | $this->includeTemplate('includes/PlanetFullCombatResults.inc.php', array('FullPlanetCombatResults'=>$CombatResults, |
| 27 | - 'MinimalDisplay'=>false, |
|
| 28 | - 'AlreadyDestroyed'=>false)); |
|
| 27 | + 'MinimalDisplay'=>false, |
|
| 28 | + 'AlreadyDestroyed'=>false)); |
|
| 29 | 29 | } |
| 30 | 30 | ?> |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | } else { |
| 7 | 7 | // Killed by port, planet, forces |
| 8 | 8 | echo 'The <span class="creds"> ' . number_format($KillResults['LostCredits']) |
| 9 | - . '</span> credits that were onboard ' . $TargetPlayer->getDisplayName() |
|
| 10 | - . "'s ship are lost in the wreckage.<br />"; |
|
| 9 | + . '</span> credits that were onboard ' . $TargetPlayer->getDisplayName() |
|
| 10 | + . "'s ship are lost in the wreckage.<br />"; |
|
| 11 | 11 | } |
| 12 | 12 | ?> |