We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -20,13 +20,13 @@ |
||
20 | 20 | const USER_SCORE_NAME = 'User Score'; |
21 | 21 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
22 | 22 | while ($db->nextRecord()) { |
23 | - $hof =& $hofTypes; |
|
23 | + $hof = & $hofTypes; |
|
24 | 24 | $typeList = explode(':', $db->getField('type')); |
25 | 25 | foreach ($typeList as $type) { |
26 | 26 | if (!isset($hof[$type])) { |
27 | 27 | $hof[$type] = array(); |
28 | 28 | } |
29 | - $hof =& $hof[$type]; |
|
29 | + $hof = & $hof[$type]; |
|
30 | 30 | } |
31 | 31 | $hof = true; |
32 | 32 | } |
@@ -1,18 +1,21 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | require_once(get_file_loc('hof.functions.inc')); |
3 | 3 | $game_id = null; |
4 | -if (isset($var['game_id'])) $game_id = $var['game_id']; |
|
4 | +if (isset($var['game_id'])) { |
|
5 | + $game_id = $var['game_id']; |
|
6 | +} |
|
5 | 7 | |
6 | 8 | if (empty($game_id)) { |
7 | 9 | $topic = 'All Time Hall of Fame'; |
8 | -} |
|
9 | -else { |
|
10 | +} else { |
|
10 | 11 | $topic = 'Hall of Fame: ' . SmrGame::getGame($game_id)->getDisplayName(); |
11 | 12 | } |
12 | 13 | $template->assign('PageTopic', $topic); |
13 | 14 | |
14 | 15 | $container = create_container('skeleton.php', 'hall_of_fame_player_detail.php'); |
15 | -if (isset($game_id)) $container['game_id'] = $game_id; |
|
16 | +if (isset($game_id)) { |
|
17 | + $container['game_id'] = $game_id; |
|
18 | +} |
|
16 | 19 | $template->assign('PersonalHofHREF', SmrSession::getNewHREF($container)); |
17 | 20 | |
18 | 21 | $db->query('SELECT type FROM hof_visibility WHERE visibility != ' . $db->escapeString(HOF_PRIVATE) . ' ORDER BY type'); |
@@ -35,8 +38,7 @@ discard block |
||
35 | 38 | if (!isset($var['view'])) { |
36 | 39 | $categories = getHofCategories($hofTypes, $game_id, $account->getAccountID()); |
37 | 40 | $template->assign('Categories', $categories); |
38 | -} |
|
39 | -else { |
|
41 | +} else { |
|
40 | 42 | $gameIDSql = ' AND game_id ' . (isset($game_id) ? '= ' . $db->escapeNumber($game_id) : 'IN (SELECT game_id FROM game WHERE end_time < ' . TIME . ' AND ignore_stats = ' . $db->escapeBoolean(false) . ')'); |
41 | 43 | |
42 | 44 | $vis = HOF_PUBLIC; |
@@ -44,15 +46,14 @@ discard block |
||
44 | 46 | $foundMe = false; |
45 | 47 | $viewType = $var['type']; |
46 | 48 | $viewType[] = $var['view']; |
47 | - if ($var['view'] == DONATION_NAME) |
|
48 | - $db->query('SELECT account_id, SUM(amount) as amount FROM account_donated |
|
49 | + if ($var['view'] == DONATION_NAME) { |
|
50 | + $db->query('SELECT account_id, SUM(amount) as amount FROM account_donated |
|
49 | 51 | GROUP BY account_id ORDER BY amount DESC, account_id ASC LIMIT 25'); |
50 | - else if ($var['view'] == USER_SCORE_NAME) { |
|
52 | + } else if ($var['view'] == USER_SCORE_NAME) { |
|
51 | 53 | $statements = SmrAccount::getUserScoreCaseStatement($db); |
52 | 54 | $query = 'SELECT account_id, ' . $statements['CASE'] . ' amount FROM (SELECT account_id, type, SUM(amount) amount FROM player_hof WHERE type IN (' . $statements['IN'] . ')' . $gameIDSql . ' GROUP BY account_id,type) x GROUP BY account_id ORDER BY amount DESC, account_id ASC LIMIT 25'; |
53 | 55 | $db->query($query); |
54 | - } |
|
55 | - else { |
|
56 | + } else { |
|
56 | 57 | $db->query('SELECT visibility FROM hof_visibility WHERE type = ' . $db->escapeArray($viewType, false, true, ':', false) . ' LIMIT 1'); |
57 | 58 | if ($db->nextRecord()) { |
58 | 59 | $vis = $db->getField('visibility'); |
@@ -20,13 +20,13 @@ |
||
20 | 20 | const USER_SCORE_NAME = 'User Score'; |
21 | 21 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
22 | 22 | while ($db->nextRecord()) { |
23 | - $hof =& $hofTypes; |
|
23 | + $hof = & $hofTypes; |
|
24 | 24 | $typeList = explode(':', $db->getField('type')); |
25 | 25 | foreach ($typeList as $type) { |
26 | 26 | if (!isset($hof[$type])) { |
27 | 27 | $hof[$type] = array(); |
28 | 28 | } |
29 | - $hof =& $hof[$type]; |
|
29 | + $hof = & $hof[$type]; |
|
30 | 30 | } |
31 | 31 | $hof = true; |
32 | 32 | } |
@@ -19,8 +19,7 @@ |
||
19 | 19 | </tr><?php |
20 | 20 | if (isset($Locations)) { |
21 | 21 | $this->includeTemplate('includes/ViewLocations.inc', array('Locations'=>$Locations)); |
22 | -} |
|
23 | -else { ?> |
|
22 | +} else { ?> |
|
24 | 23 | <tr> |
25 | 24 | <td><input name="name" type="text" value="<?php echo htmlspecialchars($Location->getName()); ?>" /></td> |
26 | 25 | <td><input name="action" type="text" value="<?php echo htmlspecialchars($Location->getAction()); ?>" /></td> |
@@ -4,8 +4,7 @@ |
||
4 | 4 | <h1>Attacker Results</h1><br /><?php |
5 | 5 | } |
6 | 6 | $this->includeTemplate('includes/PlanetTraderTeamCombatResults.inc', array('TraderTeamCombatResults'=>$FullPlanetCombatResults['Attackers'], 'MinimalDisplay'=>$MinimalDisplay)); |
7 | -} |
|
8 | -else if (!$MinimalDisplay) { |
|
7 | +} else if (!$MinimalDisplay) { |
|
9 | 8 | ?><span class="bold">The planet is already destroyed.</span><?php |
10 | 9 | } |
11 | 10 | ?><br /><?php |
@@ -180,7 +180,7 @@ |
||
180 | 180 | //heres the AIs cards |
181 | 181 | $i = 1; |
182 | 182 | if ((get_value($ai_card) == 21 && count($ai_card) == 2) || |
183 | - (get_value($player_card) > 21 && get_value($ai_card) <= 21)) { |
|
183 | + (get_value($player_card) > 21 && get_value($ai_card) <= 21)) { |
|
184 | 184 | $message .= ('<h1 class="red center">Bank Wins</h1>'); |
185 | 185 | } |
186 | 186 | $message .= ('<div class="center">Bank\'s Cards are</div><br /><table class="center"><tr>'); |
@@ -16,8 +16,7 @@ |
||
16 | 16 | $template->assign('shipArray', $shipArray); |
17 | 17 | |
18 | 18 | $template->display('ship_list.php'); |
19 | -} |
|
20 | -catch(Throwable $e) { |
|
19 | +} catch(Throwable $e) { |
|
21 | 20 | handleException($e); |
22 | 21 | } |
23 | 22 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | $template->display('ship_list.php'); |
19 | 19 | } |
20 | -catch(Throwable $e) { |
|
20 | +catch (Throwable $e) { |
|
21 | 21 | handleException($e); |
22 | 22 | } |
23 | 23 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $selector = '<select onchange="filterSelect(this)"><option>All</option>'; |
26 | 26 | $db->query('SELECT DISTINCT ' . $name . ' FROM ' . $table . ' ORDER BY ' . $name); |
27 | 27 | while ($db->nextRecord()) { |
28 | - $selector .= '<option>'.$db->getField($name).'</option>'; |
|
28 | + $selector .= '<option>' . $db->getField($name) . '</option>'; |
|
29 | 29 | } |
30 | 30 | $selector .= '</select>'; |
31 | 31 | return $selector; |
@@ -45,8 +45,7 @@ |
||
45 | 45 | $template->assign('Weapons', $weapons); |
46 | 46 | |
47 | 47 | $template->display('weapon_list.php'); |
48 | -} |
|
49 | -catch(Throwable $e) { |
|
48 | +} catch(Throwable $e) { |
|
50 | 49 | handleException($e); |
51 | 50 | } |
52 | 51 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $weapons = []; |
12 | 12 | $db->query('SELECT * FROM weapon_type JOIN race USING(race_id)'); |
13 | 13 | while ($db->nextRecord()) { |
14 | - switch($db->getInt('buyer_restriction')) { |
|
14 | + switch ($db->getInt('buyer_restriction')) { |
|
15 | 15 | case BUYER_RESTRICTION_GOOD: |
16 | 16 | $restriction = '<span class="dgreen">Good</span>'; |
17 | 17 | break; |
@@ -46,15 +46,15 @@ discard block |
||
46 | 46 | |
47 | 47 | $template->display('weapon_list.php'); |
48 | 48 | } |
49 | -catch(Throwable $e) { |
|
49 | +catch (Throwable $e) { |
|
50 | 50 | handleException($e); |
51 | 51 | } |
52 | 52 | |
53 | 53 | function buildSelector($db, $name, $table) { |
54 | 54 | $selector = '<select onchange="filterSelect(this)"><option>All</option>'; |
55 | - $db->query("SELECT DISTINCT ".$name." FROM ".$table." ORDER BY ".$name); |
|
55 | + $db->query("SELECT DISTINCT " . $name . " FROM " . $table . " ORDER BY " . $name); |
|
56 | 56 | while ($db->nextRecord()) { |
57 | - $selector .= '<option>'.$db->getField($name).'</option>'; |
|
57 | + $selector .= '<option>' . $db->getField($name) . '</option>'; |
|
58 | 58 | } |
59 | 59 | $selector .= '</select>'; |
60 | 60 | return $selector; |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | foreach (Globals::getRaces() as $raceID => $raceData) { |
67 | 67 | $raceName = $raceData['Race Name']; |
68 | 68 | $racebox .= ' |
69 | - <input type="checkbox" id="race'.$raceID.'" name="races" value="'.$raceName.'" onClick="raceToggle()"> |
|
70 | - <label for="race'.$raceID.'" class="race'.$raceID.'">'.$raceName.'</label> '; |
|
69 | + <input type="checkbox" id="race'.$raceID . '" name="races" value="' . $raceName . '" onClick="raceToggle()"> |
|
70 | + <label for="race'.$raceID . '" class="race' . $raceID . '">' . $raceName . '</label> '; |
|
71 | 71 | } |
72 | 72 | $racebox .= '</form>'; |
73 | 73 | return $racebox; |
@@ -4,15 +4,17 @@ discard block |
||
4 | 4 | // code is read-only. This will help reduce sector lag and possible abuse. |
5 | 5 | release_lock(); |
6 | 6 | |
7 | -if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false) |
|
7 | +if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false) { |
|
8 | 8 | $gameID = $var['AdminCreateGameID']; |
9 | -else |
|
9 | +} else { |
|
10 | 10 | $gameID = $player->getGameID(); |
11 | +} |
|
11 | 12 | |
12 | -if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false) |
|
13 | +if (isset($var['AdminCreateGameID']) && $var['AdminCreateGameID'] !== false) { |
|
13 | 14 | $adminCreate = true; |
14 | -else |
|
15 | +} else { |
|
15 | 16 | $adminCreate = false; |
17 | +} |
|
16 | 18 | |
17 | 19 | // NOTE: If the format of this file is changed in an incompatible way, |
18 | 20 | // make sure to update the SMR_FILE_VERSION! |
@@ -103,8 +105,9 @@ discard block |
||
103 | 105 | if ($location->isFed()) { |
104 | 106 | $locSells .= 'Fed=,'; |
105 | 107 | } |
106 | - if ($locSells != '') |
|
107 | - $file .= substr($locSells, 0, -1); |
|
108 | + if ($locSells != '') { |
|
109 | + $file .= substr($locSells, 0, -1); |
|
110 | + } |
|
108 | 111 | $file .= EOL; |
109 | 112 | } |
110 | 113 | |
@@ -125,19 +128,22 @@ discard block |
||
125 | 128 | foreach ($galaxy->getSectors() as $sector) { |
126 | 129 | $file .= '[Sector=' . $sector->getSectorID() . ']' . EOL; |
127 | 130 | |
128 | - if (!$sector->isVisited($player) && $adminCreate === false) |
|
129 | - continue; |
|
131 | + if (!$sector->isVisited($player) && $adminCreate === false) { |
|
132 | + continue; |
|
133 | + } |
|
130 | 134 | |
131 | 135 | foreach ($sector->getLinks() as $linkName => $link) { |
132 | 136 | $file .= $linkName . '=' . $link . EOL; |
133 | 137 | } |
134 | - if ($sector->hasWarp()) |
|
135 | - $file .= 'Warp=' . $sector->getWarp() . EOL; |
|
138 | + if ($sector->hasWarp()) { |
|
139 | + $file .= 'Warp=' . $sector->getWarp() . EOL; |
|
140 | + } |
|
136 | 141 | if (($adminCreate !== false && $sector->hasPort()) || is_object($player) && $sector->hasCachedPort($player)) { |
137 | - if ($adminCreate !== false) |
|
138 | - $port = $sector->getPort(); |
|
139 | - else |
|
140 | - $port = $sector->getCachedPort($player); |
|
142 | + if ($adminCreate !== false) { |
|
143 | + $port = $sector->getPort(); |
|
144 | + } else { |
|
145 | + $port = $sector->getCachedPort($player); |
|
146 | + } |
|
141 | 147 | $file .= 'Port Level=' . $port->getLevel() . EOL; |
142 | 148 | $file .= 'Port Race=' . $port->getRaceID() . EOL; |
143 | 149 | if (!empty($port->getSoldGoodIDs())) { |
@@ -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) { |