We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ -2,8 +2,8 @@ | ||
| 2 | 2 |  trait SmrMySqlSecrets { | 
| 3 | 3 | protected static $databaseName = 'smr_live'; | 
| 4 | 4 | private static $host = 'smr-mysql'; // must match MYSQL_HOST in .env | 
| 5 | - private static $user = 'smr'; // must match MYSQL_USER in .env | |
| 6 | - private static $password = 'smr'; // must match MYSQL_PASSWORD in .env | |
| 5 | + private static $user = 'smr'; // must match MYSQL_USER in .env | |
| 6 | + private static $password = 'smr'; // must match MYSQL_PASSWORD in .env | |
| 7 | 7 | |
| 8 | 8 | // Set to null to use defaults | 
| 9 | 9 | private static $port = null; | 
| @@ -49,12 +49,12 @@ | ||
| 49 | 49 | } | 
| 50 | 50 | |
| 51 | 51 |  foreach ($attackers as $attacker) { | 
| 52 | - $playerResults =& $attacker->shootPlanet($planet, false); | |
| 53 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; | |
| 52 | + $playerResults = & $attacker->shootPlanet($planet, false); | |
| 53 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; | |
| 54 | 54 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; | 
| 55 | 55 | } | 
| 56 | 56 | $results['Attackers']['Downgrades'] = $planet->checkForDowngrade($results['Attackers']['TotalDamage']); | 
| 57 | -$results['Planet'] =& $planet->shootPlayers($attackers); | |
| 57 | +$results['Planet'] = & $planet->shootPlayers($attackers); | |
| 58 | 58 | |
| 59 | 59 | $account->log(LOG_TYPE_PLANET_BUSTING, 'Player attacks planet, the planet does ' . $results['Planet']['TotalDamage'] . ', their team does ' . $results['Attackers']['TotalDamage'] . ' and downgrades: ' . var_export($results['Attackers']['Downgrades'], true), $planet->getSectorID()); | 
| 60 | 60 | |
| @@ -45,12 +45,12 @@ | ||
| 45 | 45 | } | 
| 46 | 46 | |
| 47 | 47 |  foreach ($attackers as $attacker) { | 
| 48 | - $playerResults =& $attacker->shootPort($port); | |
| 49 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; | |
| 48 | + $playerResults = & $attacker->shootPort($port); | |
| 49 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; | |
| 50 | 50 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; | 
| 51 | 51 | } | 
| 52 | 52 | $results['Attackers']['Downgrades'] = $port->checkForDowngrade($results['Attackers']['TotalDamage']); | 
| 53 | -$results['Port'] =& $port->shootPlayers($attackers); | |
| 53 | +$results['Port'] = & $port->shootPlayers($attackers); | |
| 54 | 54 | |
| 55 | 55 | $account->log(LOG_TYPE_PORT_RAIDING, 'Player attacks port, the port does ' . $results['Port']['TotalDamage'] . ', their team does ' . $results['Attackers']['TotalDamage'] . ' and downgrades ' . $results['Attackers']['Downgrades'] . ' levels.', $port->getSectorID()); | 
| 56 | 56 | |
| @@ -41,8 +41,8 @@ | ||
| 41 | 41 | |
| 42 | 42 |  function teamAttack(&$results, $fightingPlayers, $attack, $defend) { | 
| 43 | 43 |  	foreach ($fightingPlayers[$attack] as $accountID => $teamPlayer) { | 
| 44 | - $playerResults =& $teamPlayer->shootPlayers($fightingPlayers[$defend]); | |
| 45 | - $results[$attack]['Traders'][$teamPlayer->getAccountID()] =& $playerResults; | |
| 44 | + $playerResults = & $teamPlayer->shootPlayers($fightingPlayers[$defend]); | |
| 45 | + $results[$attack]['Traders'][$teamPlayer->getAccountID()] = & $playerResults; | |
| 46 | 46 | $results[$attack]['TotalDamage'] += $playerResults['TotalDamage']; | 
| 47 | 47 | |
| 48 | 48 | // Award assists (if there are multiple attackers) | 
| @@ -72,18 +72,18 @@ | ||
| 72 | 72 | |
| 73 | 73 | // If mines are bumped, the forces shoot first. Otherwise player shoots first. | 
| 74 | 74 |  if ($bump) { | 
| 75 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); | |
| 75 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); | |
| 76 | 76 | } | 
| 77 | 77 | |
| 78 | 78 |  $results['Attackers'] = array('TotalDamage' => 0); | 
| 79 | 79 |  foreach ($attackers as $attacker) { | 
| 80 | - $playerResults =& $attacker->shootForces($forces); | |
| 81 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; | |
| 80 | + $playerResults = & $attacker->shootForces($forces); | |
| 81 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; | |
| 82 | 82 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; | 
| 83 | 83 | } | 
| 84 | 84 | |
| 85 | 85 |  if (!$bump) { | 
| 86 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); | |
| 86 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); | |
| 87 | 87 | $forces->updateExpire(); | 
| 88 | 88 | } | 
| 89 | 89 | |
| @@ -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 | } | 
| @@ -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 | } | 
| @@ -446,20 +446,20 @@ | ||
| 446 | 446 | |
| 447 | 447 |  		if ($this->hasMines()) { | 
| 448 | 448 | $thisMines = new SmrMines($this->getGameID(), $this->getMines()); | 
| 449 | - $results['Results']['Mines'] =& $thisMines->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)], $minesAreAttacker); | |
| 449 | + $results['Results']['Mines'] = & $thisMines->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)], $minesAreAttacker); | |
| 450 | 450 | $results['TotalDamage'] += $results['Results']['Mines']['ActualDamage']['TotalDamage']; | 
| 451 | 451 | } | 
| 452 | 452 | |
| 453 | 453 |  		if ($this->hasCDs()) { | 
| 454 | 454 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); | 
| 455 | - $results['Results']['Drones'] =& $thisCDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]); | |
| 455 | + $results['Results']['Drones'] = & $thisCDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]); | |
| 456 | 456 | $results['TotalDamage'] += $results['Results']['Drones']['ActualDamage']['TotalDamage']; | 
| 457 | 457 | } | 
| 458 | 458 | |
| 459 | 459 |  		if (!$minesAreAttacker) { | 
| 460 | 460 |  			if ($this->hasSDs()) { | 
| 461 | 461 | $thisSDs = new SmrScoutDrones($this->getGameID(), $this->getSDs()); | 
| 462 | - $results['Results']['Scouts'] =& $thisSDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]); | |
| 462 | + $results['Results']['Scouts'] = & $thisSDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]); | |
| 463 | 463 | $results['TotalDamage'] += $results['Results']['Scouts']['ActualDamage']['TotalDamage']; | 
| 464 | 464 | } | 
| 465 | 465 | } | 
| @@ -40,7 +40,7 @@ discard block | ||
| 40 | 40 | /** | 
| 41 | 41 | * Access properties of structures that this planet type can build. | 
| 42 | 42 | */ | 
| 43 | -	public function structureTypes($structureID=false) { | |
| 43 | +	public function structureTypes($structureID = false) { | |
| 44 | 44 |  		if (!isset($this->structures)) { | 
| 45 | 45 |  			foreach (static::STRUCTURES as $ID => $Info) { | 
| 46 | 46 | $this->structures[$ID] = new SmrPlanetStructureType($ID, $Info); | 
| @@ -77,12 +77,12 @@ discard block | ||
| 77 | 77 | 'exp_gain' => 540, | 
| 78 | 78 | ], | 
| 79 | 79 | ]; | 
| 80 | -	public function name()         { return "Terran Planet"; } | |
| 81 | -	public function imageLink()    { return "images/planet1.png"; } | |
| 82 | -	public function description()  { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } | |
| 80 | +	public function name() { return "Terran Planet"; } | |
| 81 | +	public function imageLink() { return "images/planet1.png"; } | |
| 82 | +	public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } | |
| 83 | 83 |  	public function maxAttackers() { return 10; } | 
| 84 | -	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; } | |
| 85 | -	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; } | |
| 84 | +	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } | |
| 85 | +	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } | |
| 86 | 86 | } | 
| 87 | 87 | |
| 88 | 88 |  class AridPlanet extends SmrPlanetType { | 
| @@ -106,12 +106,12 @@ discard block | ||
| 106 | 106 | 'exp_gain' => 180, | 
| 107 | 107 | ], | 
| 108 | 108 | ]; | 
| 109 | -	public function name()         { return "Arid Planet"; } | |
| 110 | -	public function imageLink()    { return "images/planet2.png"; } | |
| 111 | -	public function description()  { return "A world mostly devoid of surface water, but capable of supporting life."; } | |
| 109 | +	public function name() { return "Arid Planet"; } | |
| 110 | +	public function imageLink() { return "images/planet2.png"; } | |
| 111 | +	public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } | |
| 112 | 112 |  	public function maxAttackers() { return 5; } | 
| 113 | -	public function maxLanded()    { return 5; } | |
| 114 | -	public function menuOptions()  { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } | |
| 113 | +	public function maxLanded() { return 5; } | |
| 114 | +	public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } | |
| 115 | 115 | } | 
| 116 | 116 | |
| 117 | 117 |  class DwarfPlanet extends SmrPlanetType { | 
| @@ -135,12 +135,12 @@ discard block | ||
| 135 | 135 | 'exp_gain' => 540, | 
| 136 | 136 | ], | 
| 137 | 137 | ]; | 
| 138 | -	public function name()         { return "Dwarf Planet"; } | |
| 139 | -	public function imageLink()    { return "images/planet3.png"; } | |
| 140 | -	public function description()  { return "A smaller than usual planet, with no native life present."; } | |
| 138 | +	public function name() { return "Dwarf Planet"; } | |
| 139 | +	public function imageLink() { return "images/planet3.png"; } | |
| 140 | +	public function description() { return "A smaller than usual planet, with no native life present."; } | |
| 141 | 141 |  	public function maxAttackers() { return 5; } | 
| 142 | -	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; } | |
| 143 | -	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; } | |
| 142 | +	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } | |
| 143 | +	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } | |
| 144 | 144 | } | 
| 145 | 145 | |
| 146 | 146 |  class ProtoPlanet extends SmrPlanetType { | 
| @@ -170,12 +170,12 @@ discard block | ||
| 170 | 170 | 'exp_gain' => 540, | 
| 171 | 171 | ], | 
| 172 | 172 | ]; | 
| 173 | -	public function name()         { return "Protoplanet"; } | |
| 174 | -	public function imageLink()    { return "images/planet5.png"; } | |
| 175 | -	public function description()  { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } | |
| 173 | +	public function name() { return "Protoplanet"; } | |
| 174 | +	public function imageLink() { return "images/planet5.png"; } | |
| 175 | +	public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } | |
| 176 | 176 |  	public function maxAttackers() { return 5; } | 
| 177 | -	public function maxLanded()    { return 5; } | |
| 178 | -	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; } | |
| 177 | +	public function maxLanded() { return 5; } | |
| 178 | +	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } | |
| 179 | 179 | } | 
| 180 | 180 | |
| 181 | 181 |  class DefenseWorld extends SmrPlanetType { | 
| @@ -205,10 +205,10 @@ discard block | ||
| 205 | 205 | 'exp_gain' => 9, | 
| 206 | 206 | ], | 
| 207 | 207 | ]; | 
| 208 | -	public function name()         { return "Defense World"; } | |
| 209 | -	public function imageLink()    { return "images/planet4.png"; } | |
| 210 | -	public function description()  { return "A fully armed and operational battle station loaded with excessive firepower."; } | |
| 208 | +	public function name() { return "Defense World"; } | |
| 209 | +	public function imageLink() { return "images/planet4.png"; } | |
| 210 | +	public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } | |
| 211 | 211 |  	public function maxAttackers() { return 10; } | 
| 212 | -	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; } | |
| 213 | -	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; } | |
| 212 | +	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } | |
| 213 | +	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } | |
| 214 | 214 | } |