We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | $return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
| 81 | 81 | return $return; |
| 82 | 82 | } |
| 83 | - $damage =& $this->getModifiedDamage(); |
|
| 83 | + $damage = & $this->getModifiedDamage(); |
|
| 84 | 84 | $damage['Launched'] = ceil($this->getNumberOfSDs() * $this->getModifiedForceAccuracyAgainstPlayer($forces, $targetPlayer) / 100); |
| 85 | 85 | $damage['MaxDamage'] = ceil($damage['Launched'] * $damage['MaxDamage']); |
| 86 | 86 | $damage['Shield'] = ceil($damage['Launched'] * $damage['Shield']); |
@@ -13,8 +13,7 @@ discard block |
||
| 13 | 13 | $class = ''; |
| 14 | 14 | if ($player->getAllianceID() == $currentAlliance->getAllianceID()) { |
| 15 | 15 | $class = ' class="bold"'; |
| 16 | - } |
|
| 17 | - else if ($currentAlliance->hasDisbanded()) { |
|
| 16 | + } else if ($currentAlliance->hasDisbanded()) { |
|
| 18 | 17 | $class = ' class="red"'; |
| 19 | 18 | } |
| 20 | 19 | |
@@ -61,12 +60,10 @@ discard block |
||
| 61 | 60 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'Show' && is_numeric($_REQUEST['min_rank']) && is_numeric($_REQUEST['max_rank'])) { |
| 62 | 61 | $minRank = min($_REQUEST['min_rank'], $_REQUEST['max_rank']); |
| 63 | 62 | $maxRank = max($_REQUEST['min_rank'], $_REQUEST['max_rank']); |
| 64 | - } |
|
| 65 | - elseif (isset($var['MinRank']) && isset($var['MaxRank'])) { |
|
| 63 | + } elseif (isset($var['MinRank']) && isset($var['MaxRank'])) { |
|
| 66 | 64 | $minRank = $var['MinRank']; |
| 67 | 65 | $maxRank = $var['MaxRank']; |
| 68 | - } |
|
| 69 | - else { |
|
| 66 | + } else { |
|
| 70 | 67 | $minRank = $ourRank - 5; |
| 71 | 68 | $maxRank = $ourRank + 5; |
| 72 | 69 | } |
@@ -9,8 +9,9 @@ |
||
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | protected static function initialiseDatabase() { |
| 12 | - if (self::$db == null) |
|
| 13 | - self::$db = new SmrMySqlDatabase(); |
|
| 12 | + if (self::$db == null) { |
|
| 13 | + self::$db = new SmrMySqlDatabase(); |
|
| 14 | + } |
|
| 14 | 15 | } |
| 15 | 16 | |
| 16 | 17 | /** |
@@ -126,8 +126,7 @@ discard block |
||
| 126 | 126 | $amount = $this->getHardware($hardwareTypeID); |
| 127 | 127 | if ($amount > 0) { |
| 128 | 128 | $this->db->query('REPLACE INTO ship_has_hardware (account_id, game_id, hardware_type_id, amount, old_amount) VALUES(' . $this->db->escapeNumber($this->getAccountID()) . ', ' . $this->db->escapeNumber($this->getGameID()) . ', ' . $this->db->escapeNumber($hardwareTypeID) . ', ' . $this->db->escapeNumber($amount) . ', ' . $this->db->escapeNumber($this->getOldHardware($hardwareTypeID)) . ')'); |
| 129 | - } |
|
| 130 | - else { |
|
| 129 | + } else { |
|
| 131 | 130 | $this->db->query('DELETE FROM ship_has_hardware WHERE ' . $this->SQL . ' AND hardware_type_id = ' . $this->db->escapeNumber($hardwareTypeID)); |
| 132 | 131 | } |
| 133 | 132 | } |
@@ -181,8 +180,9 @@ discard block |
||
| 181 | 180 | } |
| 182 | 181 | |
| 183 | 182 | public function isCloaked() { |
| 184 | - if (!$this->hasCloak()) |
|
| 185 | - return false; |
|
| 183 | + if (!$this->hasCloak()) { |
|
| 184 | + return false; |
|
| 185 | + } |
|
| 186 | 186 | if (!isset($this->isCloaked)) { |
| 187 | 187 | $this->db->query('SELECT 1 FROM ship_is_cloaked WHERE ' . $this->SQL . ' LIMIT 1'); |
| 188 | 188 | $this->isCloaked = $this->db->getNumRows() > 0; |
@@ -47,8 +47,7 @@ discard block |
||
| 47 | 47 | // get smr player |
| 48 | 48 | try { |
| 49 | 49 | $player = SmrPlayer::getPlayer($account->getAccountID(), $alliance->getGameId(), true); |
| 50 | - } |
|
| 51 | - catch (PlayerNotFoundException $e) { |
|
| 50 | + } catch (PlayerNotFoundException $e) { |
|
| 52 | 51 | if ($validationMessages === true) { |
| 53 | 52 | fputs($fp, 'PRIVMSG ' . $channel . ' :' . $nick . ', you have not joined the game that this channel belongs to.' . EOL); |
| 54 | 53 | } |
@@ -85,36 +84,50 @@ discard block |
||
| 85 | 84 | return true; |
| 86 | 85 | } |
| 87 | 86 | |
| 88 | - if (channel_msg_money($fp, $rdata, $account, $player)) |
|
| 89 | - return true; |
|
| 90 | - if (channel_msg_forces($fp, $rdata, $account, $player)) |
|
| 91 | - return true; |
|
| 87 | + if (channel_msg_money($fp, $rdata, $account, $player)) { |
|
| 88 | + return true; |
|
| 89 | + } |
|
| 90 | + if (channel_msg_forces($fp, $rdata, $account, $player)) { |
|
| 91 | + return true; |
|
| 92 | + } |
|
| 92 | 93 | |
| 93 | - if (channel_msg_seed($fp, $rdata, $account, $player)) |
|
| 94 | - return true; |
|
| 95 | - if (channel_msg_seedlist_add($fp, $rdata, $account, $player)) |
|
| 96 | - return true; |
|
| 97 | - if (channel_msg_seedlist_del($fp, $rdata, $account, $player)) |
|
| 98 | - return true; |
|
| 94 | + if (channel_msg_seed($fp, $rdata, $account, $player)) { |
|
| 95 | + return true; |
|
| 96 | + } |
|
| 97 | + if (channel_msg_seedlist_add($fp, $rdata, $account, $player)) { |
|
| 98 | + return true; |
|
| 99 | + } |
|
| 100 | + if (channel_msg_seedlist_del($fp, $rdata, $account, $player)) { |
|
| 101 | + return true; |
|
| 102 | + } |
|
| 99 | 103 | |
| 100 | - if (channel_msg_op_info($fp, $rdata, $account, $player)) |
|
| 101 | - return true; |
|
| 102 | - if (channel_msg_op_cancel($fp, $rdata, $account, $player)) |
|
| 103 | - return true; |
|
| 104 | - if (channel_msg_op_set($fp, $rdata, $account, $player)) |
|
| 105 | - return true; |
|
| 106 | - if (channel_msg_op_turns($fp, $rdata, $account, $player)) |
|
| 107 | - return true; |
|
| 108 | - if (channel_msg_op_response($fp, $rdata, $account, $player)) |
|
| 109 | - return true; |
|
| 110 | - if (channel_msg_op_list($fp, $rdata, $account, $player)) |
|
| 111 | - return true; |
|
| 112 | - if (channel_msg_sd_set($fp, $rdata, $account, $player)) |
|
| 113 | - return true; |
|
| 114 | - if (channel_msg_sd_del($fp, $rdata, $account, $player)) |
|
| 115 | - return true; |
|
| 116 | - if (channel_msg_sd_list($fp, $rdata, $account, $player)) |
|
| 117 | - return true; |
|
| 104 | + if (channel_msg_op_info($fp, $rdata, $account, $player)) { |
|
| 105 | + return true; |
|
| 106 | + } |
|
| 107 | + if (channel_msg_op_cancel($fp, $rdata, $account, $player)) { |
|
| 108 | + return true; |
|
| 109 | + } |
|
| 110 | + if (channel_msg_op_set($fp, $rdata, $account, $player)) { |
|
| 111 | + return true; |
|
| 112 | + } |
|
| 113 | + if (channel_msg_op_turns($fp, $rdata, $account, $player)) { |
|
| 114 | + return true; |
|
| 115 | + } |
|
| 116 | + if (channel_msg_op_response($fp, $rdata, $account, $player)) { |
|
| 117 | + return true; |
|
| 118 | + } |
|
| 119 | + if (channel_msg_op_list($fp, $rdata, $account, $player)) { |
|
| 120 | + return true; |
|
| 121 | + } |
|
| 122 | + if (channel_msg_sd_set($fp, $rdata, $account, $player)) { |
|
| 123 | + return true; |
|
| 124 | + } |
|
| 125 | + if (channel_msg_sd_del($fp, $rdata, $account, $player)) { |
|
| 126 | + return true; |
|
| 127 | + } |
|
| 128 | + if (channel_msg_sd_list($fp, $rdata, $account, $player)) { |
|
| 129 | + return true; |
|
| 130 | + } |
|
| 118 | 131 | |
| 119 | 132 | } |
| 120 | 133 | |
@@ -253,8 +266,9 @@ discard block |
||
| 253 | 266 | $countdown = intval($msg[5]); |
| 254 | 267 | $message = 'ALERT! ALERT! ALERT!'; |
| 255 | 268 | |
| 256 | - if (isset($msg[6])) |
|
| 257 | - $message .= ' ' . $msg[6]; |
|
| 269 | + if (isset($msg[6])) { |
|
| 270 | + $message .= ' ' . $msg[6]; |
|
| 271 | + } |
|
| 258 | 272 | |
| 259 | 273 | echo_r('[TIMER] ' . $nick . ' started a timer with ' . $countdown . ' minute(s) (' . $message . ') in ' . $channel); |
| 260 | 274 | |
@@ -364,8 +378,9 @@ discard block |
||
| 364 | 378 | if ($topic == 'seen') { |
| 365 | 379 | fputs($fp, 'NOTICE ' . $nick . ' :Syntax !seen <nickname>' . EOL); |
| 366 | 380 | fputs($fp, 'NOTICE ' . $nick . ' : Displays the last time <nickname> was seen' . EOL); |
| 367 | - } else |
|
| 368 | - fputs($fp, 'NOTICE ' . $nick . ' :There is no help available for this command! Try !help' . EOL); |
|
| 381 | + } else { |
|
| 382 | + fputs($fp, 'NOTICE ' . $nick . ' :There is no help available for this command! Try !help' . EOL); |
|
| 383 | + } |
|
| 369 | 384 | |
| 370 | 385 | // if ($topic == 'login') |
| 371 | 386 | // fputs($fp, 'NOTICE '.$nick.' :No help available yet! Ask MrSpock!'.EOL); |
@@ -4,7 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | $fn_seed = function($message) { |
| 6 | 6 | $link = new GameLink($message->channel, $message->author); |
| 7 | - if (!$link->valid) return; |
|
| 7 | + if (!$link->valid) { |
|
| 8 | + return; |
|
| 9 | + } |
|
| 8 | 10 | |
| 9 | 11 | $result = shared_channel_msg_seed($link->player); |
| 10 | 12 | $message->channel->sendMessage(join(EOL, $result)); |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $fn_turns = function($message) { |
| 19 | 19 | $link = new GameLink($message->channel, $message->author); |
| 20 | - if (!$link->valid) return; |
|
| 20 | + if (!$link->valid) { |
|
| 21 | + return; |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $msg = get_turns_message($link->player); |
| 23 | 25 | $message->channel->sendMessage($msg); |
@@ -25,7 +27,9 @@ discard block |
||
| 25 | 27 | |
| 26 | 28 | $fn_turns_all = function($message) { |
| 27 | 29 | $link = new GameLink($message->channel, $message->author); |
| 28 | - if (!$link->valid) return; |
|
| 30 | + if (!$link->valid) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 29 | 33 | $player = $link->player; |
| 30 | 34 | |
| 31 | 35 | $results = array_map('get_turns_message', $player->getSharingPlayers(true)); |
@@ -6,7 +6,9 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | $fn_op = function($message) { |
| 8 | 8 | $link = new GameLink($message->channel, $message->author); |
| 9 | - if (!$link->valid) return; |
|
| 9 | + if (!$link->valid) { |
|
| 10 | + return; |
|
| 11 | + } |
|
| 10 | 12 | $player = $link->player; |
| 11 | 13 | |
| 12 | 14 | // print info about the next op |
@@ -16,7 +18,9 @@ discard block |
||
| 16 | 18 | |
| 17 | 19 | $fn_op_list = function($message) { |
| 18 | 20 | $link = new GameLink($message->channel, $message->author); |
| 19 | - if (!$link->valid) return; |
|
| 21 | + if (!$link->valid) { |
|
| 22 | + return; |
|
| 23 | + } |
|
| 20 | 24 | $player = $link->player; |
| 21 | 25 | |
| 22 | 26 | // print list of attendees |
@@ -26,7 +30,9 @@ discard block |
||
| 26 | 30 | |
| 27 | 31 | $fn_op_turns = function($message) { |
| 28 | 32 | $link = new GameLink($message->channel, $message->author); |
| 29 | - if (!$link->valid) return; |
|
| 33 | + if (!$link->valid) { |
|
| 34 | + return; |
|
| 35 | + } |
|
| 30 | 36 | $player = $link->player; |
| 31 | 37 | |
| 32 | 38 | // print list of attendees |
@@ -2,7 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | $fn_game = function($message) { |
| 4 | 4 | $link = new GameLink($message->channel, $message->author); |
| 5 | - if (!$link->valid) return; |
|
| 5 | + if (!$link->valid) { |
|
| 6 | + return; |
|
| 7 | + } |
|
| 6 | 8 | |
| 7 | 9 | $game = SmrGame::getGame($link->player->getGameID(), true); |
| 8 | 10 | $msg = "I am linked to game `" . $game->getDisplayName() . "` in this channel."; |