Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — master ( 05708e...0d7dc4 )
by Dan
04:00
created
src/lib/Default/SmrScoutDrones.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
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'] = ICeil($this->getNumberOfSDs() * $this->getModifiedForceAccuracyAgainstPlayer($forces, $targetPlayer) / 100);
85 85
 		$damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage']);
86 86
 		$damage['Shield'] = ICeil($damage['Launched'] * $damage['Shield']);
Please login to merge, or discard this patch.
src/lib/Default/AbstractMenu.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Defense');
13 13
 		$menuItems[] = array('Link'=>Globals::getPlanetListFinancialHREF($alliance_id), 'Text'=>'Financial');
14 14
 		// make the selected index bold
15
-		$boldItem =& $menuItems[$selected_index]['Text'];
15
+		$boldItem = & $menuItems[$selected_index]['Text'];
16 16
 		$boldItem = '<span class="bold">' . $boldItem . '</span>';
17 17
 		$template->assign('MenuItems', $menuItems);
18 18
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
108 108
 		                'Text' => 'Game News'];
109 109
 		// make the selected index bold
110
-		$boldItem =& $menuItems[$selected_index]['Text'];
110
+		$boldItem = & $menuItems[$selected_index]['Text'];
111 111
 		$boldItem = '<b>' . $boldItem . '</b>';
112 112
 		$template->assign('MenuItems', $menuItems);
113 113
 	}
Please login to merge, or discard this patch.
src/lib/Default/SmrPlanet.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 		$results['DeadBeforeShot'] = false;
1147 1147
 		$weapons = $this->getWeapons();
1148 1148
 		foreach ($weapons as $orderID => $weapon) {
1149
-			$results['Weapons'][$orderID] =& $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1149
+			$results['Weapons'][$orderID] = & $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1150 1150
 			if ($results['Weapons'][$orderID]['Hit']) {
1151 1151
 				$results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
1152 1152
 				$results['TotalDamagePerTargetPlayer'][$results['Weapons'][$orderID]['TargetPlayer']->getAccountID()] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
 		}
1155 1155
 		if ($this->hasCDs()) {
1156 1156
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true);
1157
-			$results['Drones'] =& $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1157
+			$results['Drones'] = & $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]);
1158 1158
 			$results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage'];
1159 1159
 			$results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage'];
1160 1160
 		}
Please login to merge, or discard this patch.
src/lib/Default/SmrPlanetType.class.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrCombatWeapon.class.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -85,68 +85,68 @@
 block discarded – undo
85 85
 	abstract public function &getModifiedForceDamageAgainstPlayer(SmrForce $forces, AbstractSmrPlayer $targetPlayer);
86 86
 	
87 87
 	protected function &doPlayerDamageToForce(array &$return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) {
88
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstForces($weaponPlayer,$forces);
89
-		$return['ActualDamage'] =& $forces->doWeaponDamage($return['WeaponDamage']);
90
-		if($return['ActualDamage']['KillingShot']) {
91
-			$return['KillResults'] =& $forces->killForcesByPlayer($weaponPlayer);
88
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstForces($weaponPlayer, $forces);
89
+		$return['ActualDamage'] = & $forces->doWeaponDamage($return['WeaponDamage']);
90
+		if ($return['ActualDamage']['KillingShot']) {
91
+			$return['KillResults'] = & $forces->killForcesByPlayer($weaponPlayer);
92 92
 		}
93 93
 		return $return;
94 94
 	}
95 95
 	
96 96
 	protected function &doPlayerDamageToPlayer(array &$return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) {
97
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer);
98
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
97
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer);
98
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
99 99
 
100
-		if($return['ActualDamage']['KillingShot']) {
101
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlayer($weaponPlayer);
100
+		if ($return['ActualDamage']['KillingShot']) {
101
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlayer($weaponPlayer);
102 102
 		}
103 103
 		return $return;
104 104
 	}
105 105
 	
106 106
 	protected function &doPlayerDamageToPort(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) {
107
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPort($weaponPlayer,$port);
108
-		$return['ActualDamage'] =& $port->doWeaponDamage($return['WeaponDamage']);
109
-		if($return['ActualDamage']['KillingShot']) {
110
-			$return['KillResults'] =& $port->killPortByPlayer($weaponPlayer);
107
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPort($weaponPlayer, $port);
108
+		$return['ActualDamage'] = & $port->doWeaponDamage($return['WeaponDamage']);
109
+		if ($return['ActualDamage']['KillingShot']) {
110
+			$return['KillResults'] = & $port->killPortByPlayer($weaponPlayer);
111 111
 		}
112 112
 		return $return;
113 113
 	}
114 114
 	
115 115
 	protected function &doPlayerDamageToPlanet(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) {
116
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet);
117
-		$return['ActualDamage'] =& $planet->doWeaponDamage($return['WeaponDamage'],$delayed);
118
-		if($return['ActualDamage']['KillingShot']) {
119
-			$return['KillResults'] =& $planet->killPlanetByPlayer($weaponPlayer);
116
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet);
117
+		$return['ActualDamage'] = & $planet->doWeaponDamage($return['WeaponDamage'], $delayed);
118
+		if ($return['ActualDamage']['KillingShot']) {
119
+			$return['KillResults'] = & $planet->killPlanetByPlayer($weaponPlayer);
120 120
 		}
121 121
 		return $return;
122 122
 	}
123 123
 	
124 124
 	protected function &doPortDamageToPlayer(array &$return, SmrPort $port, AbstractSmrPlayer $targetPlayer) {
125
-		$return['WeaponDamage'] =& $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer);
126
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
125
+		$return['WeaponDamage'] = & $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer);
126
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
127 127
 
128
-		if($return['ActualDamage']['KillingShot']) {
129
-			$return['KillResults'] =& $targetPlayer->killPlayerByPort($port);
128
+		if ($return['ActualDamage']['KillingShot']) {
129
+			$return['KillResults'] = & $targetPlayer->killPlayerByPort($port);
130 130
 		}
131 131
 		return $return;
132 132
 	}
133 133
 	
134 134
 	protected function &doPlanetDamageToPlayer(array &$return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) {
135
-		$return['WeaponDamage'] =& $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer);
136
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
135
+		$return['WeaponDamage'] = & $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer);
136
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
137 137
 
138
-		if($return['ActualDamage']['KillingShot']) {
139
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlanet($planet);
138
+		if ($return['ActualDamage']['KillingShot']) {
139
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlanet($planet);
140 140
 		}
141 141
 		return $return;
142 142
 	}
143 143
 	
144 144
 	protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) {
145
-		$return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer);
146
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
145
+		$return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer);
146
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
147 147
 
148
-		if($return['ActualDamage']['KillingShot']) {
149
-			$return['KillResults'] =& $targetPlayer->killPlayerByForces($forces);
148
+		if ($return['ActualDamage']['KillingShot']) {
149
+			$return['KillResults'] = & $targetPlayer->killPlayerByForces($forces);
150 150
 		}
151 151
 		return $return;
152 152
 	}
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrPort.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 			do {
1181 1181
 				$targetPlayer = $targetPlayers[array_rand($targetPlayers)];
1182 1182
 			} while ($results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()] > min($results['TotalShotsPerTargetPlayer']));
1183
-			$results['Weapons'][$orderID] =& $weapon->shootPlayerAsPort($this, $targetPlayer);
1183
+			$results['Weapons'][$orderID] = & $weapon->shootPlayerAsPort($this, $targetPlayer);
1184 1184
 			$results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()]++;
1185 1185
 			if ($results['Weapons'][$orderID]['Hit']) {
1186 1186
 				$results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage'];
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 		}
1190 1190
 		if ($this->hasCDs()) {
1191 1191
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true);
1192
-			$results['Drones'] =& $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]);
1192
+			$results['Drones'] = & $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]);
1193 1193
 			$results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage'];
1194 1194
 			$results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage'];
1195 1195
 		}
Please login to merge, or discard this patch.
src/lib/Default/MySqlDatabase.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
src/lib/Default/DummyShip.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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() {
Please login to merge, or discard this patch.
src/lib/Default/DummyPlayer.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.