@@ -18,7 +18,6 @@ |
||
| 18 | 18 | |
| 19 | 19 | namespace GameQ\Protocols; |
| 20 | 20 | |
| 21 | -use GameQ\Buffer; |
|
| 22 | 21 | use GameQ\Result; |
| 23 | 22 | |
| 24 | 23 | /** |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ\Protocols; |
| 20 | 20 | |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | // Delete some unknown stuff |
| 100 | - $this->deleteResult($result, [ 's1', 's9', 's11', 's12', 's13', 's14' ]); |
|
| 100 | + $this->deleteResult($result, ['s1', 's9', 's11', 's12', 's13', 's14']); |
|
| 101 | 101 | |
| 102 | 102 | // Return the result |
| 103 | 103 | return $result; |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - * |
|
| 18 | - * |
|
| 19 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + * |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | namespace GameQ; |
| 22 | 22 | |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | { |
| 275 | 275 | |
| 276 | 276 | // Get position of delimiters |
| 277 | - $pos = [ ]; |
|
| 277 | + $pos = []; |
|
| 278 | 278 | foreach ($delims as $delim) { |
| 279 | 279 | if ($p = strpos($this->data, $delim, min($this->index, $this->length))) { |
| 280 | 280 | $pos[] = $p; |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - * |
|
| 18 | - * |
|
| 19 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + * |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | namespace GameQ\Exception; |
| 22 | 22 | |
@@ -33,14 +33,14 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @type array |
| 35 | 35 | */ |
| 36 | - protected $options = [ ]; |
|
| 36 | + protected $options = []; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Construct |
| 40 | 40 | * |
| 41 | 41 | * @param array $options |
| 42 | 42 | */ |
| 43 | - public function __construct($options = [ ]) |
|
| 43 | + public function __construct($options = []) |
|
| 44 | 44 | { |
| 45 | 45 | |
| 46 | 46 | $this->options = $options; |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ\Filters; |
| 20 | 20 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @type array |
| 35 | 35 | */ |
| 36 | - protected $normalize = [ ]; |
|
| 36 | + protected $normalize = []; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Apply this filter |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $result['players'][$key] = array_merge($player, $this->check('player', $player)); |
| 68 | 68 | } |
| 69 | 69 | } else { |
| 70 | - $result['players'] = [ ]; |
|
| 70 | + $result['players'] = []; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Do team information |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $result['teams'][$key] = array_merge($team, $this->check('team', $team)); |
| 78 | 78 | } |
| 79 | 79 | } else { |
| 80 | - $result['teams'] = [ ]; |
|
| 80 | + $result['teams'] = []; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | //$data['filtered'][$server->id()] = $result; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | { |
| 103 | 103 | |
| 104 | 104 | // Normalized return array |
| 105 | - $normalized = [ ]; |
|
| 105 | + $normalized = []; |
|
| 106 | 106 | |
| 107 | 107 | if (isset($this->normalize[$section]) && !empty($this->normalize[$section])) { |
| 108 | 108 | foreach ($this->normalize[$section] as $property => $raw) { |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ\Filters; |
| 20 | 20 | |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | namespace GameQ; |
| 19 | 19 | |
| 20 | 20 | use GameQ\Exception\Protocol as ProtocolException; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | protected $options = [ |
| 83 | 83 | 'debug' => false, |
| 84 | 84 | 'timeout' => 3, // Seconds |
| 85 | - 'filters' => [ 'normalize' => [ ] ], |
|
| 85 | + 'filters' => ['normalize' => []], |
|
| 86 | 86 | // Advanced settings |
| 87 | 87 | 'stream_timeout' => 200000, // See http://www.php.net/manual/en/function.stream-select.php for more info |
| 88 | 88 | 'write_wait' => 500, |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @type array |
| 99 | 99 | */ |
| 100 | - protected $servers = [ ]; |
|
| 100 | + protected $servers = []; |
|
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * The query library to use. Default is Native |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | * |
| 167 | 167 | * @return $this |
| 168 | 168 | */ |
| 169 | - public function addServer(array $server_info = [ ]) |
|
| 169 | + public function addServer(array $server_info = []) |
|
| 170 | 170 | { |
| 171 | 171 | |
| 172 | 172 | // Add and validate the server |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * |
| 183 | 183 | * @return $this |
| 184 | 184 | */ |
| 185 | - public function addServers(array $servers = [ ]) |
|
| 185 | + public function addServers(array $servers = []) |
|
| 186 | 186 | { |
| 187 | 187 | |
| 188 | 188 | // Loop through all the servers and add them |
@@ -203,12 +203,12 @@ discard block |
||
| 203 | 203 | * @return $this |
| 204 | 204 | * @throws \Exception |
| 205 | 205 | */ |
| 206 | - public function addServersFromFiles($files = [ ]) |
|
| 206 | + public function addServersFromFiles($files = []) |
|
| 207 | 207 | { |
| 208 | 208 | |
| 209 | 209 | // Since we expect an array let us turn a string (i.e. single file) into an array |
| 210 | 210 | if (!is_array($files)) { |
| 211 | - $files = [ $files ]; |
|
| 211 | + $files = [$files]; |
|
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | // Iterate over the file(s) and add them |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | { |
| 243 | 243 | |
| 244 | 244 | // Reset all the servers |
| 245 | - $this->servers = [ ]; |
|
| 245 | + $this->servers = []; |
|
| 246 | 246 | |
| 247 | 247 | return $this; // Make Chainable |
| 248 | 248 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | * |
| 256 | 256 | * @return $this |
| 257 | 257 | */ |
| 258 | - public function addFilter($filterName, $options = [ ]) |
|
| 258 | + public function addFilter($filterName, $options = []) |
|
| 259 | 259 | { |
| 260 | 260 | |
| 261 | 261 | // Add the filter |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | unset($class); |
| 304 | 304 | |
| 305 | 305 | // Define the return |
| 306 | - $results = [ ]; |
|
| 306 | + $results = []; |
|
| 307 | 307 | |
| 308 | 308 | // @todo: Add break up into loop to split large arrays into smaller chunks |
| 309 | 309 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | { |
| 341 | 341 | |
| 342 | 342 | // Initialize the sockets for reading |
| 343 | - $sockets = [ ]; |
|
| 343 | + $sockets = []; |
|
| 344 | 344 | |
| 345 | 345 | // By default we don't have any challenges to process |
| 346 | 346 | $server_challenge = false; |
@@ -385,8 +385,8 @@ discard block |
||
| 385 | 385 | if ($server_challenge) { |
| 386 | 386 | // Now we need to listen for and grab challenge response(s) |
| 387 | 387 | $responses = call_user_func_array( |
| 388 | - [ $this->query, 'getResponses' ], |
|
| 389 | - [ $sockets, $this->timeout, $this->stream_timeout ] |
|
| 388 | + [$this->query, 'getResponses'], |
|
| 389 | + [$sockets, $this->timeout, $this->stream_timeout] |
|
| 390 | 390 | ); |
| 391 | 391 | |
| 392 | 392 | // Iterate over the challenge responses |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | { |
| 421 | 421 | |
| 422 | 422 | // Initialize the array of sockets |
| 423 | - $sockets = [ ]; |
|
| 423 | + $sockets = []; |
|
| 424 | 424 | |
| 425 | 425 | // Iterate over the server list |
| 426 | 426 | foreach ($this->servers as $server_id => $server) { |
@@ -474,8 +474,8 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | // Now we need to listen for and grab response(s) |
| 476 | 476 | $responses = call_user_func_array( |
| 477 | - [ $this->query, 'getResponses' ], |
|
| 478 | - [ $sockets, $this->timeout, $this->stream_timeout ] |
|
| 477 | + [$this->query, 'getResponses'], |
|
| 478 | + [$sockets, $this->timeout, $this->stream_timeout] |
|
| 479 | 479 | ); |
| 480 | 480 | |
| 481 | 481 | // Iterate over the responses |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | $class = new \ReflectionClass(sprintf('GameQ\\Filters\\%s', ucfirst($filterName))); |
| 583 | 583 | |
| 584 | 584 | // Create a new instance of the filter class specified |
| 585 | - $filter = $class->newInstanceArgs([ $filterOptions ]); |
|
| 585 | + $filter = $class->newInstanceArgs([$filterOptions]); |
|
| 586 | 586 | |
| 587 | 587 | // Apply the filter to the data |
| 588 | 588 | $results = $filter->apply($results, $server); |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - * |
|
| 18 | - * |
|
| 19 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + * |
|
| 18 | + * |
|
| 19 | + */ |
|
| 20 | 20 | |
| 21 | 21 | namespace GameQ; |
| 22 | 22 | |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @type array |
| 112 | 112 | */ |
| 113 | - protected $packets = [ ]; |
|
| 113 | + protected $packets = []; |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * Holds the response headers and the method to use to process them. |
| 117 | 117 | * |
| 118 | 118 | * @type array |
| 119 | 119 | */ |
| 120 | - protected $responses = [ ]; |
|
| 120 | + protected $responses = []; |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * Holds the list of methods to run when parsing the packet response(s) data. These |
@@ -125,14 +125,14 @@ discard block |
||
| 125 | 125 | * |
| 126 | 126 | * @type array |
| 127 | 127 | */ |
| 128 | - protected $process_methods = [ ]; |
|
| 128 | + protected $process_methods = []; |
|
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | 131 | * The packet responses received |
| 132 | 132 | * |
| 133 | 133 | * @type array |
| 134 | 134 | */ |
| 135 | - protected $packets_response = [ ]; |
|
| 135 | + protected $packets_response = []; |
|
| 136 | 136 | |
| 137 | 137 | /** |
| 138 | 138 | * Holds the instance of the result class |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * |
| 147 | 147 | * @type array |
| 148 | 148 | */ |
| 149 | - protected $options = [ ]; |
|
| 149 | + protected $options = []; |
|
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | 152 | * Define the state of this class |
@@ -174,26 +174,26 @@ discard block |
||
| 174 | 174 | 'bf2142dedicated', |
| 175 | 175 | 'dedicated' |
| 176 | 176 | ], |
| 177 | - 'gametype' => [ 'ggametype', 'sigametype', 'matchtype' ], |
|
| 178 | - 'hostname' => [ 'svhostname', 'servername', 'siname', 'name' ], |
|
| 179 | - 'mapname' => [ 'map', 'simap' ], |
|
| 180 | - 'maxplayers' => [ 'svmaxclients', 'simaxplayers', 'maxclients', 'max_players' ], |
|
| 181 | - 'mod' => [ 'game', 'gamedir', 'gamevariant' ], |
|
| 182 | - 'numplayers' => [ 'clients', 'sinumplayers', 'num_players' ], |
|
| 183 | - 'password' => [ 'protected', 'siusepass', 'sineedpass', 'pswrd', 'gneedpass', 'auth', 'passsord' ], |
|
| 177 | + 'gametype' => ['ggametype', 'sigametype', 'matchtype'], |
|
| 178 | + 'hostname' => ['svhostname', 'servername', 'siname', 'name'], |
|
| 179 | + 'mapname' => ['map', 'simap'], |
|
| 180 | + 'maxplayers' => ['svmaxclients', 'simaxplayers', 'maxclients', 'max_players'], |
|
| 181 | + 'mod' => ['game', 'gamedir', 'gamevariant'], |
|
| 182 | + 'numplayers' => ['clients', 'sinumplayers', 'num_players'], |
|
| 183 | + 'password' => ['protected', 'siusepass', 'sineedpass', 'pswrd', 'gneedpass', 'auth', 'passsord'], |
|
| 184 | 184 | ], |
| 185 | 185 | // Indvidual |
| 186 | 186 | 'player' => [ |
| 187 | - 'name' => [ 'nick', 'player', 'playername', 'name' ], |
|
| 188 | - 'kills' => [ 'kills' ], |
|
| 189 | - 'deaths' => [ 'deaths' ], |
|
| 190 | - 'score' => [ 'kills', 'frags', 'skill', 'score' ], |
|
| 191 | - 'ping' => [ 'ping' ], |
|
| 187 | + 'name' => ['nick', 'player', 'playername', 'name'], |
|
| 188 | + 'kills' => ['kills'], |
|
| 189 | + 'deaths' => ['deaths'], |
|
| 190 | + 'score' => ['kills', 'frags', 'skill', 'score'], |
|
| 191 | + 'ping' => ['ping'], |
|
| 192 | 192 | ], |
| 193 | 193 | // Team |
| 194 | 194 | 'team' => [ |
| 195 | - 'name' => [ 'name', 'teamname', 'team_t' ], |
|
| 196 | - 'score' => [ 'score', 'score_t' ], |
|
| 195 | + 'name' => ['name', 'teamname', 'team_t'], |
|
| 196 | + 'score' => ['score', 'score_t'], |
|
| 197 | 197 | ], |
| 198 | 198 | ]; |
| 199 | 199 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | /** |
| 208 | 208 | * @param array $options |
| 209 | 209 | */ |
| 210 | - public function __construct(array $options = [ ]) |
|
| 210 | + public function __construct(array $options = []) |
|
| 211 | 211 | { |
| 212 | 212 | |
| 213 | 213 | // Set the options for this specific instance of the class |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | * |
| 332 | 332 | * @return array |
| 333 | 333 | */ |
| 334 | - public function options($options = [ ]) |
|
| 334 | + public function options($options = []) |
|
| 335 | 335 | { |
| 336 | 336 | |
| 337 | 337 | // Act as setter |
@@ -354,10 +354,10 @@ discard block |
||
| 354 | 354 | * |
| 355 | 355 | * @return array |
| 356 | 356 | */ |
| 357 | - public function getPacket($type = [ ]) |
|
| 357 | + public function getPacket($type = []) |
|
| 358 | 358 | { |
| 359 | 359 | |
| 360 | - $packets = [ ]; |
|
| 360 | + $packets = []; |
|
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | // We want an array of packets back |
@@ -1,20 +1,20 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * This file is part of GameQ. |
|
| 4 | - * |
|
| 5 | - * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | - * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | - * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | - * (at your option) any later version. |
|
| 9 | - * |
|
| 10 | - * GameQ is distributed in the hope that it will be useful, |
|
| 11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | - * GNU Lesser General Public License for more details. |
|
| 14 | - * |
|
| 15 | - * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | - */ |
|
| 3 | + * This file is part of GameQ. |
|
| 4 | + * |
|
| 5 | + * GameQ is free software; you can redistribute it and/or modify |
|
| 6 | + * it under the terms of the GNU Lesser General Public License as published by |
|
| 7 | + * the Free Software Foundation; either version 3 of the License, or |
|
| 8 | + * (at your option) any later version. |
|
| 9 | + * |
|
| 10 | + * GameQ is distributed in the hope that it will be useful, |
|
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 13 | + * GNU Lesser General Public License for more details. |
|
| 14 | + * |
|
| 15 | + * You should have received a copy of the GNU Lesser General Public License |
|
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 17 | + */ |
|
| 18 | 18 | |
| 19 | 19 | namespace GameQ\Protocols; |
| 20 | 20 | |