We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', Request::get('game_join')); |
5 | -$start = empty(Request::get('game_start')) ? $join : |
|
6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
5 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
7 | 6 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
8 | 7 | |
9 | 8 | $game = SmrGame::getGame($var['game_id']); |
@@ -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 @@ discard block |
||
19 | 19 | $shareFrom[$fromAccountId] = array( |
20 | 20 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
21 | 21 | 'Player Name' => $otherPlayer == null ? |
22 | - '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : |
|
23 | - $otherPlayer->getDisplayName(), |
|
22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
24 | 23 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
25 | 24 | 'Game ID' => $gameId, |
26 | 25 | ); |
@@ -40,8 +39,7 @@ discard block |
||
40 | 39 | $shareTo[$toAccountId] = array( |
41 | 40 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
42 | 41 | 'Player Name' => $otherPlayer == null ? |
43 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : |
|
44 | - $otherPlayer->getDisplayName(), |
|
42 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
45 | 43 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
46 | 44 | 'Game ID' => $gameId, |
47 | 45 | ); |
@@ -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 | } |
@@ -3,10 +3,10 @@ |
||
3 | 3 | // Holds information linking the received message and the game data |
4 | 4 | class GameLink |
5 | 5 | { |
6 | - public $valid = false; // identifies if the message is linked to game data |
|
7 | - public $account; // SmrAccount instance |
|
8 | - public $alliance; // SmrAlliance instance |
|
9 | - public $player; // SmrPlayer instance |
|
6 | + public $valid = false; // identifies if the message is linked to game data |
|
7 | + public $account; // SmrAccount instance |
|
8 | + public $alliance; // SmrAlliance instance |
|
9 | + public $player; // SmrPlayer instance |
|
10 | 10 | |
11 | 11 | // $author can be either Discord\Parts\User\{User,Member} |
12 | 12 | function __construct(Discord\Parts\Channel\Channel $channel, $author) { |
@@ -18,8 +18,7 @@ |
||
18 | 18 | if ($join === false) { |
19 | 19 | create_error('Join Date is not valid!'); |
20 | 20 | } |
21 | -$start = empty(Request::get('game_start')) ? $join : |
|
22 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
21 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
23 | 22 | if ($start === false) { |
24 | 23 | create_error('Start Date is not valid!'); |
25 | 24 | } |
@@ -374,13 +374,13 @@ |
||
374 | 374 | $this->db->query('SELECT type,sum(amount) as amount FROM player_hof WHERE ' . $this->SQL . ' AND game_id IN (SELECT game_id FROM game WHERE ignore_stats = \'FALSE\') GROUP BY type'); |
375 | 375 | $this->HOF = array(); |
376 | 376 | while ($this->db->nextRecord()) { |
377 | - $hof =& $this->HOF; |
|
377 | + $hof = & $this->HOF; |
|
378 | 378 | $typeList = explode(':', $this->db->getField('type')); |
379 | 379 | foreach ($typeList as $type) { |
380 | 380 | if (!isset($hof[$type])) { |
381 | 381 | $hof[$type] = array(); |
382 | 382 | } |
383 | - $hof =& $hof[$type]; |
|
383 | + $hof = & $hof[$type]; |
|
384 | 384 | } |
385 | 385 | $hof = $this->db->getFloat('amount'); |
386 | 386 | } |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | 'exp_gain' => 540, |
80 | 80 | ], |
81 | 81 | ]; |
82 | - public function name() { return "Terran Planet"; } |
|
83 | - public function imageLink() { return "images/planet1.png"; } |
|
84 | - public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
82 | + public function name() { return "Terran Planet"; } |
|
83 | + public function imageLink() { return "images/planet1.png"; } |
|
84 | + public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
85 | 85 | public function maxAttackers() { return 10; } |
86 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
87 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
86 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
87 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | class AridPlanet extends SmrPlanetType { |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | 'exp_gain' => 180, |
109 | 109 | ], |
110 | 110 | ]; |
111 | - public function name() { return "Arid Planet"; } |
|
112 | - public function imageLink() { return "images/planet2.png"; } |
|
113 | - public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
111 | + public function name() { return "Arid Planet"; } |
|
112 | + public function imageLink() { return "images/planet2.png"; } |
|
113 | + public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
114 | 114 | public function maxAttackers() { return 5; } |
115 | - public function maxLanded() { return 5; } |
|
116 | - public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
115 | + public function maxLanded() { return 5; } |
|
116 | + public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | class DwarfPlanet extends SmrPlanetType { |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | 'exp_gain' => 540, |
138 | 138 | ], |
139 | 139 | ]; |
140 | - public function name() { return "Dwarf Planet"; } |
|
141 | - public function imageLink() { return "images/planet3.png"; } |
|
142 | - public function description() { return "A smaller than usual planet, with no native life present."; } |
|
140 | + public function name() { return "Dwarf Planet"; } |
|
141 | + public function imageLink() { return "images/planet3.png"; } |
|
142 | + public function description() { return "A smaller than usual planet, with no native life present."; } |
|
143 | 143 | public function maxAttackers() { return 5; } |
144 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
145 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
144 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
145 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | class ProtoPlanet extends SmrPlanetType { |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | 'exp_gain' => 540, |
179 | 179 | ], |
180 | 180 | ]; |
181 | - public function name() { return "Protoplanet"; } |
|
182 | - public function imageLink() { return "images/planet5.png"; } |
|
183 | - public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
181 | + public function name() { return "Protoplanet"; } |
|
182 | + public function imageLink() { return "images/planet5.png"; } |
|
183 | + public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
184 | 184 | public function maxAttackers() { return 5; } |
185 | - public function maxLanded() { return 5; } |
|
186 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
185 | + public function maxLanded() { return 5; } |
|
186 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | class DefenseWorld extends SmrPlanetType { |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | 'exp_gain' => 9, |
214 | 214 | ], |
215 | 215 | ]; |
216 | - public function name() { return "Defense World"; } |
|
217 | - public function imageLink() { return "images/planet4.png"; } |
|
218 | - public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
216 | + public function name() { return "Defense World"; } |
|
217 | + public function imageLink() { return "images/planet4.png"; } |
|
218 | + public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
219 | 219 | public function maxAttackers() { return 10; } |
220 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
221 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
220 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
221 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
222 | 222 | } |
@@ -230,13 +230,13 @@ |
||
230 | 230 | $planet->increaseBuilding(PLANET_HANGAR, 4); |
231 | 231 | $this->assertTrue($planet->hasBuilding(PLANET_HANGAR)); |
232 | 232 | $this->assertSame(4, $planet->getBuilding(PLANET_HANGAR)); |
233 | - $this->assertSame(4/3, $planet->getLevel()); |
|
233 | + $this->assertSame(4 / 3, $planet->getLevel()); |
|
234 | 234 | |
235 | 235 | // Destroy some hangars |
236 | 236 | $planet->destroyBuilding(PLANET_HANGAR, 2); |
237 | 237 | $this->assertTrue($planet->hasBuilding(PLANET_HANGAR)); |
238 | 238 | $this->assertSame(2, $planet->getBuilding(PLANET_HANGAR)); |
239 | - $this->assertSame(2/3, $planet->getLevel()); |
|
239 | + $this->assertSame(2 / 3, $planet->getLevel()); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | } |