We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ -11,8 +11,7 @@ discard block | ||
| 11 | 11 |  $action = Request::get('action'); | 
| 12 | 12 |  if (Request::get('save') == 'Yes') { | 
| 13 | 13 | $save = true; | 
| 14 | -} | |
| 15 | -else { | |
| 14 | +} else { | |
| 16 | 15 | $save = false; | 
| 17 | 16 | } | 
| 18 | 17 | |
| @@ -42,8 +41,7 @@ discard block | ||
| 42 | 41 |  				$mines = $db2->getInt('sum_m'); | 
| 43 | 42 |  				$cds = $db2->getInt('cds'); | 
| 44 | 43 |  				$sds = $db2->getInt('sds'); | 
| 45 | - } | |
| 46 | -			else { | |
| 44 | +			} else { | |
| 47 | 45 | $mines = 0; | 
| 48 | 46 | $cds = 0; | 
| 49 | 47 | $sds = 0; | 
| @@ -143,16 +141,25 @@ discard block | ||
| 143 | 141 |  			$owner = $db->getInt('owner_id'); | 
| 144 | 142 | |
| 145 | 143 |  			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1'); | 
| 146 | -			if ($db2->nextRecord()) $gens = $db2->getInt('amount'); | |
| 147 | - else $gens = 0; | |
| 144 | +			if ($db2->nextRecord()) { | |
| 145 | +				$gens = $db2->getInt('amount'); | |
| 146 | +			} else { | |
| 147 | + $gens = 0; | |
| 148 | + } | |
| 148 | 149 | |
| 149 | 150 |  			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2'); | 
| 150 | -			if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); | |
| 151 | - else $hangs = 0; | |
| 151 | +			if ($db2->nextRecord()) { | |
| 152 | +				$hangs = $db2->getInt('amount'); | |
| 153 | +			} else { | |
| 154 | + $hangs = 0; | |
| 155 | + } | |
| 152 | 156 | |
| 153 | 157 |  			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3'); | 
| 154 | -			if ($db2->nextRecord()) $turs = $db2->getInt('amount'); | |
| 155 | - else $turs = 0; | |
| 158 | +			if ($db2->nextRecord()) { | |
| 159 | +				$turs = $db2->getInt('amount'); | |
| 160 | +			} else { | |
| 161 | + $turs = 0; | |
| 162 | + } | |
| 156 | 163 | |
| 157 | 164 | // insert into history db | 
| 158 | 165 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . | 
| @@ -189,14 +196,21 @@ discard block | ||
| 189 | 196 | $smrCredits = 0; | 
| 190 | 197 |  			$db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0'); | 
| 191 | 198 |  			if ($db2->nextRecord()) { | 
| 192 | -				if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); | |
| 193 | -				if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); | |
| 199 | +				if (is_int($db2->getField('bounty_am'))) { | |
| 200 | +					$amount = $db2->getInt('bounty_am'); | |
| 201 | + } | |
| 202 | +				if (is_int($db2->getField('bounty_cred'))) { | |
| 203 | +					$smrCredits = $db2->getInt('bounty_cred'); | |
| 204 | + } | |
| 194 | 205 | |
| 195 | 206 | } | 
| 196 | 207 | |
| 197 | 208 |  			$db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id); | 
| 198 | -			if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); | |
| 199 | - else $ship_name = 'None'; | |
| 209 | +			if ($db2->nextRecord()) { | |
| 210 | +				$ship_name = $db2->getField('ship_name'); | |
| 211 | +			} else { | |
| 212 | + $ship_name = 'None'; | |
| 213 | + } | |
| 200 | 214 | |
| 201 | 215 | // insert into history db | 
| 202 | 216 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . | 
| @@ -244,9 +258,15 @@ discard block | ||
| 244 | 258 |  				$mines = $db2->getInt('sum_mines'); | 
| 245 | 259 |  				$cds = $db2->getInt('cds'); | 
| 246 | 260 |  				$sds = $db2->getInt('sds'); | 
| 247 | - if (!is_numeric($mines)) $mines = 0; | |
| 248 | - if (!is_numeric($cds)) $cds = 0; | |
| 249 | - if (!is_numeric($sds)) $sds = 0; | |
| 261 | +				if (!is_numeric($mines)) { | |
| 262 | + $mines = 0; | |
| 263 | + } | |
| 264 | +				if (!is_numeric($cds)) { | |
| 265 | + $cds = 0; | |
| 266 | + } | |
| 267 | +				if (!is_numeric($sds)) { | |
| 268 | + $sds = 0; | |
| 269 | + } | |
| 250 | 270 | |
| 251 | 271 |  			} else { | 
| 252 | 272 | |
| @@ -9,10 +9,11 @@ discard block | ||
| 9 | 9 | $realAttackers = array(); | 
| 10 | 10 | $attackers = array(); | 
| 11 | 11 | $i=1; | 
| 12 | -if(isset($_POST['attackers'])) | |
| 12 | +if(isset($_POST['attackers'])) { | |
| 13 | 13 |  	foreach($_POST['attackers'] as $attackerName) { | 
| 14 | 14 | if($attackerName=='none') | 
| 15 | 15 | continue; | 
| 16 | +} | |
| 16 | 17 |  		if(isset($usedNames[$attackerName])) { | 
| 17 | 18 | $duplicates = true; | 
| 18 | 19 | continue; | 
| @@ -24,17 +25,19 @@ discard block | ||
| 24 | 25 | ++$i; | 
| 25 | 26 | } | 
| 26 | 27 | |
| 27 | -for(;$i<=10;++$i) | |
| 28 | +for(;$i<=10;++$i) { | |
| 28 | 29 | $attackers[$i] = null; | 
| 30 | +} | |
| 29 | 31 |  $template->assign('Attackers',$attackers); | 
| 30 | 32 | |
| 31 | 33 | $i=1; | 
| 32 | 34 | $realDefenders = array(); | 
| 33 | 35 | $defenders = array(); | 
| 34 | -if(isset($_POST['defenders'])) | |
| 36 | +if(isset($_POST['defenders'])) { | |
| 35 | 37 |  	foreach($_POST['defenders'] as $defenderName) { | 
| 36 | 38 | if($defenderName=='none') | 
| 37 | 39 | continue; | 
| 40 | +} | |
| 38 | 41 |  		if(isset($usedNames[$defenderName])) { | 
| 39 | 42 | $duplicates = true; | 
| 40 | 43 | continue; | 
| @@ -46,8 +49,9 @@ discard block | ||
| 46 | 49 | ++$i; | 
| 47 | 50 | } | 
| 48 | 51 | |
| 49 | -for(;$i<=10;++$i) | |
| 52 | +for(;$i<=10;++$i) { | |
| 50 | 53 | $defenders[$i] = null; | 
| 54 | +} | |
| 51 | 55 |  $template->assign('Defenders',$defenders); | 
| 52 | 56 | |
| 53 | 57 |  $template->assign('Duplicates',$duplicates); | 
| @@ -62,12 +66,14 @@ discard block | ||
| 62 | 66 |  		while(count($realAttackers)>0 && count($realDefenders)>0) { | 
| 63 | 67 | runAnAttack($realAttackers,$realDefenders); | 
| 64 | 68 |  			foreach($realAttackers as $key => &$teamPlayer) { | 
| 65 | - if($teamPlayer->isDead()) | |
| 66 | - unset($realAttackers[$key]); | |
| 69 | +				if($teamPlayer->isDead()) { | |
| 70 | + unset($realAttackers[$key]); | |
| 71 | + } | |
| 67 | 72 | } unset($teamPlayer); | 
| 68 | 73 |  			foreach($realDefenders as $key => &$teamPlayer) { | 
| 69 | - if($teamPlayer->isDead()) | |
| 70 | - unset($realDefenders[$key]); | |
| 74 | +				if($teamPlayer->isDead()) { | |
| 75 | + unset($realDefenders[$key]); | |
| 76 | + } | |
| 71 | 77 | } unset($teamPlayer); | 
| 72 | 78 | } | 
| 73 | 79 | } | 
| @@ -76,8 +76,13 @@ 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 (Globals::getRaces() as $race) { | 
| 79 | - if ($race['Race ID'] == $ThisPlayer->getRaceID()) continue; | |
| 80 | - if ($race['Race ID'] == RACE_NEUTRAL) continue; ?> | |
| 79 | +			if ($race['Race ID'] == $ThisPlayer->getRaceID()) { | |
| 80 | + continue; | |
| 81 | + } | |
| 82 | +			if ($race['Race ID'] == RACE_NEUTRAL) { | |
| 83 | + continue; | |
| 84 | + } | |
| 85 | + ?> | |
| 81 | 86 | <option value="<?php echo $race['Race ID']; ?>"><?php echo $race['Race Name']; ?></option><?php | 
| 82 | 87 | } ?> | 
| 83 | 88 | </select>   | 
| @@ -88,8 +93,13 @@ discard block | ||
| 88 | 93 | <form method="POST" action="<?php echo $ChangeRaceHREF; ?>"> | 
| 89 | 94 | <select name="race"><?php | 
| 90 | 95 |  		foreach (Globals::getRaces() as $race) { | 
| 91 | - if ($race['Race ID'] == $ThisPlayer->getRaceID()) continue; | |
| 92 | - if ($race['Race ID'] == RACE_NEUTRAL) continue; ?> | |
| 96 | +			if ($race['Race ID'] == $ThisPlayer->getRaceID()) { | |
| 97 | + continue; | |
| 98 | + } | |
| 99 | +			if ($race['Race ID'] == RACE_NEUTRAL) { | |
| 100 | + continue; | |
| 101 | + } | |
| 102 | + ?> | |
| 93 | 103 | <option value="<?php echo $race['Race ID']; ?>"><?php echo $race['Race Name']; ?></option><?php | 
| 94 | 104 | } ?> | 
| 95 | 105 | </select>   | 
| @@ -10,7 +10,10 @@ | ||
| 10 | 10 | <td style="width: 80%" class="center"> | 
| 11 | 11 | Local Map of the Known <span class="big bold"><?php echo $GalaxyName ?></span> Galaxy | 
| 12 | 12 | <br /><br /> | 
| 13 | - <?php if (isset($Error)) echo $Error; ?> | |
| 13 | +			<?php if (isset($Error)) { | |
| 14 | + echo $Error; | |
| 15 | +} | |
| 16 | +?> | |
| 14 | 17 | </td> | 
| 15 | 18 | <td style="width: 10%"></td> | 
| 16 | 19 | </tr> | 
| @@ -68,8 +68,7 @@ | ||
| 68 | 68 | |
| 69 | 69 | </body> | 
| 70 | 70 | </html><?php | 
| 71 | -} | |
| 72 | -catch (Throwable $e) { | |
| 71 | +} catch (Throwable $e) { | |
| 73 | 72 | handleException($e); | 
| 74 | 73 | } | 
| 75 | 74 | ?> | 
| @@ -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 | } | 
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | 
| 2 | -<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) echo ": $GameName"; ?></title> | |
| 2 | +<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) { | |
| 3 | + echo ": $GameName"; | |
| 4 | +} | |
| 5 | +?></title> | |
| 3 | 6 | <meta http-equiv="pragma" content="no-cache" /><?php | 
| 4 | 7 |  if (!is_object($ThisAccount) || $ThisAccount->isDefaultCSSEnabled()) { ?> | 
| 5 | 8 | <link rel="stylesheet" type="text/css" href="<?php echo $CSSLink; ?>" /> | 
| @@ -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> | 
| @@ -469,8 +469,9 @@ | ||
| 469 | 469 | |
| 470 | 470 | if (!$player->isDead() && $player->getNewbieTurns() <= NEWBIE_TURNS_WARNING_LIMIT && | 
| 471 | 471 | $player->getNewbieWarning() && | 
| 472 | - $var['url'] != 'newbie_warning_processing.php') | |
| 473 | -			forward(create_container('newbie_warning_processing.php')); | |
| 472 | +			$var['url'] != 'newbie_warning_processing.php') { | |
| 473 | +					forward(create_container('newbie_warning_processing.php')); | |
| 474 | + } | |
| 474 | 475 | } | 
| 475 | 476 | |
| 476 | 477 | // Initialize the template |