@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param \GameQ\Buffer $buffer |
149 | 149 | * @param \GameQ\Result $result |
150 | 150 | */ |
151 | - protected function processKeyValuePairs(Buffer &$buffer, Result &$result) |
|
151 | + protected function processKeyValuePairs(Buffer & $buffer, Result & $result) |
|
152 | 152 | { |
153 | 153 | |
154 | 154 | // Key / value pairs |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @param \GameQ\Buffer $buffer |
177 | 177 | * @param \GameQ\Result $result |
178 | 178 | */ |
179 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
179 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
180 | 180 | { |
181 | 181 | |
182 | 182 | // Players and team info |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | |
141 | 141 | // Results that will be returned |
142 | - $results = [ ]; |
|
142 | + $results = []; |
|
143 | 143 | |
144 | 144 | // Get the length of the server code so we can figure out how much to read later |
145 | 145 | $serverCodeLength = strlen($this->server_code); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | // Now we need to call the proper method |
171 | 171 | $results = array_merge( |
172 | 172 | $results, |
173 | - call_user_func_array([ $this, $this->responses[$response_type] ], [ $buffer ]) |
|
173 | + call_user_func_array([$this, $this->responses[$response_type]], [$buffer]) |
|
174 | 174 | ); |
175 | 175 | |
176 | 176 | unset($buffer); |
@@ -120,7 +120,7 @@ |
||
120 | 120 | |
121 | 121 | // Build the server code |
122 | 122 | $this->server_code = implode('', array_map('chr', explode('.', $server->ip()))) . |
123 | - pack("S", $server->portClient()); |
|
123 | + pack("S", $server->portClient()); |
|
124 | 124 | |
125 | 125 | // Loop over the packets and update them |
126 | 126 | foreach ($this->packets as $packetType => $packet) { |
@@ -200,7 +200,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -170,7 +170,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -90,7 +90,7 @@ |
||
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]; |
@@ -200,12 +200,12 @@ |
||
200 | 200 | // Check to see if the response is empty, if so we are done with this server |
201 | 201 | if (strlen($response) == 0) { |
202 | 202 | // Remove this server from any future read loops |
203 | - unset($sockets_tmp[(int)$socket]); |
|
203 | + unset($sockets_tmp[(int) $socket]); |
|
204 | 204 | continue; |
205 | 205 | } |
206 | 206 | |
207 | 207 | // Add the response we got back |
208 | - $responses[(int)$socket][] = $response; |
|
208 | + $responses[(int) $socket][] = $response; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | // Because stream_select modifies read we need to reset it each time to the original array of sockets |
@@ -838,7 +838,7 @@ discard block |
||
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 |
||
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 |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @param \GameQ\Buffer $buffer |
223 | 223 | * @param \GameQ\Result $result |
224 | 224 | */ |
225 | - protected function processDetails(Buffer &$buffer, Result &$result) |
|
225 | + protected function processDetails(Buffer & $buffer, Result & $result) |
|
226 | 226 | { |
227 | 227 | |
228 | 228 | // We go until we hit an empty key |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @param \GameQ\Buffer $buffer |
242 | 242 | * @param \GameQ\Result $result |
243 | 243 | */ |
244 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
244 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
245 | 245 | { |
246 | 246 | |
247 | 247 | /* |
@@ -164,7 +164,7 @@ |
||
164 | 164 | * @param array $data |
165 | 165 | * @param \GameQ\Result $result |
166 | 166 | */ |
167 | - protected function processChannelsAndUsers(array $data, Result &$result) |
|
167 | + protected function processChannelsAndUsers(array $data, Result & $result) |
|
168 | 168 | { |
169 | 169 | |
170 | 170 | // Let's add all of the channel information |