Completed
Pull Request — v3 (#296)
by
unknown
04:12
created
src/GameQ/Protocols/Teamspeak2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      * @param string        $data
201 201
      * @param \GameQ\Result $result
202 202
      */
203
-    protected function processDetails($data, Result &$result)
203
+    protected function processDetails($data, Result & $result)
204 204
     {
205 205
 
206 206
         // Create a buffer
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * @param string        $data
231 231
      * @param \GameQ\Result $result
232 232
      */
233
-    protected function processChannels($data, Result &$result)
233
+    protected function processChannels($data, Result & $result)
234 234
     {
235 235
 
236 236
         // Create a buffer
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      * @param string        $data
263 263
      * @param \GameQ\Result $result
264 264
      */
265
-    protected function processPlayers($data, Result &$result)
265
+    protected function processPlayers($data, Result & $result)
266 266
     {
267 267
 
268 268
         // Create a buffer
Please login to merge, or discard this patch.
src/GameQ/Protocols/Teamspeak3.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     {
221 221
 
222 222
         // Will hold the properties we are sending back
223
-        $properties = [ ];
223
+        $properties = [];
224 224
 
225 225
         // All of these are split on space
226 226
         $items = explode(' ', $data);
@@ -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/Ut3.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/GameQ/Protocols/Ventrilo.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -748,17 +748,17 @@  discard block
 block discarded – undo
748 748
      * @return string
749 749
      * @throws \GameQ\Exception\Protocol
750 750
      */
751
-    protected function decryptPackets(array $packets = [ ])
751
+    protected function decryptPackets(array $packets = [])
752 752
     {
753 753
 
754 754
         // This will be returned
755
-        $decrypted = [ ];
755
+        $decrypted = [];
756 756
 
757 757
         foreach ($packets as $packet) {
758 758
             # Header :
759 759
             $header = substr($packet, 0, 20);
760 760
 
761
-            $header_items = [ ];
761
+            $header_items = [];
762 762
 
763 763
             $header_key = unpack("n1", $header);
764 764
 
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
      * @param int           $fieldCount
839 839
      * @param \GameQ\Result $result
840 840
      */
841
-    protected function processChannel($data, $fieldCount, Result &$result)
841
+    protected function processChannel($data, $fieldCount, Result & $result)
842 842
     {
843 843
 
844 844
         // Split the items on the comma
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
      * @param int           $fieldCount
861 861
      * @param \GameQ\Result $result
862 862
      */
863
-    protected function processPlayer($data, $fieldCount, Result &$result)
863
+    protected function processPlayer($data, $fieldCount, Result & $result)
864 864
     {
865 865
 
866 866
         // Split the items on the comma
Please login to merge, or discard this patch.
src/GameQ/Query/Native.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,10 +134,10 @@
 block discarded – undo
134 134
         $loop_active = true;
135 135
 
136 136
         // Will hold the responses read from the sockets
137
-        $responses = [ ];
137
+        $responses = [];
138 138
 
139 139
         // To store the sockets
140
-        $sockets_tmp = [ ];
140
+        $sockets_tmp = [];
141 141
 
142 142
         // Loop and pull out all the actual sockets we need to listen on
143 143
         foreach ($sockets as $socket_id => $socket_data) {
Please login to merge, or discard this patch.
src/GameQ/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      *
33 33
      * @var        array
34 34
      */
35
-    protected $result = [ ];
35
+    protected $result = [];
36 36
 
37 37
     /**
38 38
      * Adds variable to results
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         // Nothing of this type yet, set an empty array
84 84
         if (!isset($this->result[$sub]) or !is_array($this->result[$sub])) {
85
-            $this->result[$sub] = [ ];
85
+            $this->result[$sub] = [];
86 86
         }
87 87
 
88 88
         // Find the first entry that doesn't have this variable
Please login to merge, or discard this patch.
src/GameQ/Server.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 $server_addr = explode(':', $ip_address);
171 171
 
172 172
                 // Port is the last item in the array, remove it and save
173
-                $this->port_client = (int)array_pop($server_addr);
173
+                $this->port_client = (int) array_pop($server_addr);
174 174
 
175 175
                 // The rest is the address, recombine
176 176
                 $this->ip = implode(':', $server_addr);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             }
186 186
 
187 187
             // Now let's validate the IPv6 value sent, remove the square brackets ([]) first
188
-            if (!filter_var(trim($this->ip, '[]'), FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV6,])) {
188
+            if (!filter_var(trim($this->ip, '[]'), FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV6, ])) {
189 189
                 throw new Exception("The IPv6 address '{$this->ip}' is invalid.");
190 190
             }
191 191
         } else {
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 list($this->ip, $this->port_client) = explode(':', $ip_address);
195 195
 
196 196
                 // Type case the port
197
-                $this->port_client = (int)$this->port_client;
197
+                $this->port_client = (int) $this->port_client;
198 198
             } else {
199 199
                 // No port, fail
200 200
                 throw new Exception(
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             }
205 205
 
206 206
             // Validate the IPv4 value, if FALSE is not a valid IP, maybe a hostname.  Try to resolve
207
-            if (!filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV4,])
207
+            if (!filter_var($this->ip, FILTER_VALIDATE_IP, ['flags' => FILTER_FLAG_IPV4, ])
208 208
                 && $this->ip === gethostbyname($this->ip)
209 209
             ) {
210 210
                 // When gethostbyname() fails it returns the original string
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
         // Specific query port defined
224 224
         if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
225
-            $this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
225
+            $this->port_query = (int) $this->options[self::SERVER_OPTIONS_QUERY_PORT];
226 226
         } else {
227 227
             // Do math based on the protocol class
228 228
             $this->port_query = $this->protocol->findQueryPort($this->port_client);
Please login to merge, or discard this patch.
src/GameQ/Protocols/Gamespy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
             }
91 91
 
92 92
             // Multiply so we move the decimal point out of the way, if there is one
93
-            $key = (int)(floatval($matches[2]) * 1000);
93
+            $key = (int) (floatval($matches[2]) * 1000);
94 94
 
95 95
             // Add this packet to the processed
96 96
             $processed[$key] = $matches[1];
Please login to merge, or discard this patch.
src/GameQ/Protocols/Quake3.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
             throw new Exception(__METHOD__ . " response type '" . bin2hex($header) . "' is not valid");
109 109
         }
110 110
 
111
-        return call_user_func_array([$this, $this->responses[ $header ]], [$buffer]);
111
+        return call_user_func_array([$this, $this->responses[$header]], [$buffer]);
112 112
     }
113 113
 
114 114
     protected function processStatus(Buffer $buffer)
Please login to merge, or discard this patch.