Completed
Pull Request — v3 (#389)
by Soner
03:50
created
src/GameQ/Protocols/Starmade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      * @return array
159 159
      * @throws \GameQ\Exception\Protocol
160 160
      */
161
-    protected function parseServerParameters(Buffer &$buffer)
161
+    protected function parseServerParameters(Buffer & $buffer)
162 162
     {
163 163
 
164 164
         // Init the parsed data array
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
                 // Boolean
203 203
                 case 5:
204
-                    $parsed[$i] = (bool)$buffer->readInt8Signed();
204
+                    $parsed[$i] = (bool) $buffer->readInt8Signed();
205 205
                     break;
206 206
 
207 207
                 // 8-bit int
Please login to merge, or discard this patch.
src/GameQ/Protocols/Tshock.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $result->add('serverversion', $json->serverversion);
121 121
         $result->add('world', $json->world);
122 122
         $result->add('uptime', $json->uptime);
123
-        $result->add('password', (int)$json->serverpassword);
123
+        $result->add('password', (int) $json->serverpassword);
124 124
         $result->add('numplayers', $json->playercount);
125 125
         $result->add('maxplayers', $json->maxplayers);
126 126
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             $result->addPlayer('nickname', $player->nickname);
130 130
             $result->addPlayer('username', $player->username);
131 131
             $result->addPlayer('group', $player->group);
132
-            $result->addPlayer('active', (int)$player->active);
132
+            $result->addPlayer('active', (int) $player->active);
133 133
             $result->addPlayer('state', $player->state);
134 134
             $result->addPlayer('team', $player->team);
135 135
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         // Parse rules
141 141
         foreach ($json->rules as $rule => $value) {
142 142
             // Add rule but convert boolean into int (0|1)
143
-            $rules[$rule] = (is_bool($value)) ? (int)$value : $value;
143
+            $rules[$rule] = (is_bool($value)) ? (int) $value : $value;
144 144
         }
145 145
 
146 146
         // Add rules
Please login to merge, or discard this patch.
src/GameQ/Protocols/Bfbc2.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -224,13 +224,13 @@  discard block
 block discarded – undo
224 224
 
225 225
         // These are the same no matter what mode the server is in
226 226
         $result->add('hostname', $items[1]);
227
-        $result->add('num_players', (int)$items[2]);
228
-        $result->add('max_players', (int)$items[3]);
227
+        $result->add('num_players', (int) $items[2]);
228
+        $result->add('max_players', (int) $items[3]);
229 229
         $result->add('gametype', $items[4]);
230 230
         $result->add('map', $items[5]);
231
-        $result->add('roundsplayed', (int)$items[6]);
232
-        $result->add('roundstotal', (int)$items[7]);
233
-        $result->add('num_teams', (int)$items[8]);
231
+        $result->add('roundsplayed', (int) $items[6]);
232
+        $result->add('roundstotal', (int) $items[7]);
233
+        $result->add('num_teams', (int) $items[8]);
234 234
 
235 235
         // Set the current index
236 236
         $index_current = 9;
@@ -247,13 +247,13 @@  discard block
 block discarded – undo
247 247
         }
248 248
 
249 249
         // Get and set the rest of the data points.
250
-        $result->add('targetscore', (int)$items[$index_current]);
250
+        $result->add('targetscore', (int) $items[$index_current]);
251 251
         $result->add('online', 1); // Forced true, shows accepting players
252 252
         $result->add('ranked', (($items[$index_current + 2] == 'true') ? 1 : 0));
253 253
         $result->add('punkbuster', (($items[$index_current + 3] == 'true') ? 1 : 0));
254 254
         $result->add('password', (($items[$index_current + 4] == 'true') ? 1 : 0));
255
-        $result->add('uptime', (int)$items[$index_current + 5]);
256
-        $result->add('roundtime', (int)$items[$index_current + 6]);
255
+        $result->add('uptime', (int) $items[$index_current + 5]);
256
+        $result->add('roundtime', (int) $items[$index_current + 6]);
257 257
         $result->add('mod', $items[$index_current + 7]);
258 258
 
259 259
         $result->add('ip_port', $items[$index_current + 9]);
Please login to merge, or discard this patch.
src/GameQ/Protocols/Etqw.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * @param Buffer $buffer
188 188
      * @param Result $result
189 189
      */
190
-    protected function parsePlayers(Buffer &$buffer, Result &$result)
190
+    protected function parsePlayers(Buffer & $buffer, Result & $result)
191 191
     {
192 192
         // By default there are 0 players
193 193
         $players = 0;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      * @param Buffer $buffer
217 217
      * @param Result $result
218 218
      */
219
-    protected function parsePlayersExtra(Buffer &$buffer, Result &$result)
219
+    protected function parsePlayersExtra(Buffer & $buffer, Result & $result)
220 220
     {
221 221
         // Iterate over the extra player info
222 222
         while (($id = $buffer->readInt8()) != 32) {
Please login to merge, or discard this patch.
src/GameQ/GameQ.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                     $socket->write($server->protocol()->getPacket(Protocol::PACKET_CHALLENGE));
405 405
 
406 406
                     // Add the socket information so we can reference it easily
407
-                    $sockets[(int)$socket->get()] = [
407
+                    $sockets[(int) $socket->get()] = [
408 408
                         'server_id' => $server_id,
409 409
                         'socket'    => $socket,
410 410
                     ];
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                 unset($packets);
506 506
 
507 507
                 // Add the socket information so we can reference it easily
508
-                $sockets[(int)$socket->get()] = [
508
+                $sockets[(int) $socket->get()] = [
509 509
                     'server_id' => $server_id,
510 510
                     'socket'    => $socket,
511 511
                 ];
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
         $results['gq_port_client'] = $server->portClient();
602 602
         $results['gq_port_query'] = $server->portQuery();
603 603
         $results['gq_protocol'] = $server->protocol()->getProtocol();
604
-        $results['gq_type'] = (string)$server->protocol();
604
+        $results['gq_type'] = (string) $server->protocol();
605 605
         $results['gq_name'] = $server->protocol()->nameLong();
606 606
         $results['gq_transport'] = $server->protocol()->transport();
607 607
 
Please login to merge, or discard this patch.
src/GameQ/Protocols/Teamspeak3.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      * @param string        $data
252 252
      * @param \GameQ\Result $result
253 253
      */
254
-    protected function processDetails($data, Result &$result)
254
+    protected function processDetails($data, Result & $result)
255 255
     {
256 256
 
257 257
         // Offload the parsing for these values
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      * @param string        $data
281 281
      * @param \GameQ\Result $result
282 282
      */
283
-    protected function processChannels($data, Result &$result)
283
+    protected function processChannels($data, Result & $result)
284 284
     {
285 285
 
286 286
         // We need to split the data at the pipe
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      * @param string        $data
307 307
      * @param \GameQ\Result $result
308 308
      */
309
-    protected function processPlayers($data, Result &$result)
309
+    protected function processPlayers($data, Result & $result)
310 310
     {
311 311
 
312 312
         // We need to split the data at the pipe
Please login to merge, or discard this patch.
src/GameQ/Protocols/Mohaa.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,6 +74,6 @@
 block discarded – undo
74 74
      */
75 75
     public function findQueryPort($clientPort)
76 76
     {
77
-        return $clientPort+97;
77
+        return $clientPort + 97;
78 78
     }
79 79
 }
Please login to merge, or discard this patch.
src/GameQ/Protocols/Justcause2.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * @param Buffer $buffer
92 92
      * @param Result $result
93 93
      */
94
-    protected function processDetails(Buffer &$buffer, Result &$result)
94
+    protected function processDetails(Buffer & $buffer, Result & $result)
95 95
     {
96 96
         parent::processDetails($buffer, $result);
97 97
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      *
109 109
      * @see Gamespy3::processPlayersAndTeams()
110 110
      */
111
-    protected function processPlayersAndTeams(Buffer &$buffer, Result &$result)
111
+    protected function processPlayersAndTeams(Buffer & $buffer, Result & $result)
112 112
     {
113 113
         // First is the number of players, let's use this. Should have actual players, not connecting
114 114
         $result->add('numplayers', $buffer->readInt16());
Please login to merge, or discard this patch.