We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public static int $last_accessed; |
35 | 35 | private static Time $pageRequestTime; |
36 | 36 | |
37 | - protected static ?array $previousAjaxReturns; |
|
37 | + protected static ? array $previousAjaxReturns; |
|
38 | 38 | protected static array $ajaxReturns = array(); |
39 | 39 | |
40 | 40 | /** |
@@ -136,8 +136,7 @@ discard block |
||
136 | 136 | } elseif ($value['RemainingPageLoads'] < 0) { |
137 | 137 | //This link is no longer valid |
138 | 138 | unset(self::$var[$key]); |
139 | - } else { |
|
140 | - --self::$var[$key]['RemainingPageLoads']; |
|
139 | + } else {--self::$var[$key]['RemainingPageLoads']; |
|
141 | 140 | if (isset($value['CommonID'])) { |
142 | 141 | self::$commonIDs[$value['CommonID']] = $key; |
143 | 142 | } |
@@ -1,30 +1,30 @@ discard block |
||
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 |
||
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) { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $db = MySqlDatabase::getInstance(); |
76 | 76 | $db->query('REPLACE INTO cached_dummys ' . |
77 | 77 | '(type, id, info) ' . |
78 | - 'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeObject($this).')'); |
|
78 | + 'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeObject($this) . ')'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public static function &getCachedDummyPlayer($name) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $db->query('SELECT info FROM cached_dummys |
84 | 84 | WHERE type = \'DummyPlayer\' |
85 | 85 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
86 | - if($db->nextRecord()) { |
|
86 | + if ($db->nextRecord()) { |
|
87 | 87 | $return = $db->getObject('info'); |
88 | 88 | return $return; |
89 | 89 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $db->query('SELECT id FROM cached_dummys |
99 | 99 | WHERE type = \'DummyPlayer\''); |
100 | 100 | $dummyNames = array(); |
101 | - while($db->nextRecord()) { |
|
101 | + while ($db->nextRecord()) { |
|
102 | 102 | $dummyNames[] = $db->getField('id'); |
103 | 103 | } |
104 | 104 | return $dummyNames; |
@@ -48,8 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setAllianceID($ID) { |
51 | - if($this->allianceID == $ID) |
|
52 | - return; |
|
51 | + if($this->allianceID == $ID) { |
|
52 | + return; |
|
53 | + } |
|
53 | 54 | $this->allianceID=$ID; |
54 | 55 | } |
55 | 56 | |
@@ -86,8 +87,7 @@ discard block |
||
86 | 87 | if($db->nextRecord()) { |
87 | 88 | $return = $db->getObject('info'); |
88 | 89 | return $return; |
89 | - } |
|
90 | - else { |
|
90 | + } else { |
|
91 | 91 | $return = new DummyPlayer(); |
92 | 92 | return $return; |
93 | 93 | } |