@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @type array |
90 | 90 | */ |
91 | - protected $options = [ ]; |
|
91 | + protected $options = []; |
|
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Holds the sockets already open for this server |
95 | 95 | * |
96 | 96 | * @type array |
97 | 97 | */ |
98 | - protected $sockets = [ ]; |
|
98 | + protected $sockets = []; |
|
99 | 99 | |
100 | 100 | /** |
101 | 101 | * Construct the class with the passed options |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @throws \GameQ\Exception\Server |
106 | 106 | */ |
107 | - public function __construct(array $server_info = [ ]) |
|
107 | + public function __construct(array $server_info = []) |
|
108 | 108 | { |
109 | 109 | |
110 | 110 | // Check for server type |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | sprintf('GameQ\\Protocols\\%s', ucfirst(strtolower($server_info[self::SERVER_TYPE]))) |
142 | 142 | ); |
143 | 143 | |
144 | - $this->protocol = $class->newInstanceArgs([ $this->options ]); |
|
144 | + $this->protocol = $class->newInstanceArgs([$this->options]); |
|
145 | 145 | } catch (\ReflectionException $e) { |
146 | 146 | throw new Exception("Unable to locate Protocols class for '{$server_info[self::SERVER_TYPE]}'!"); |
147 | 147 | } |
@@ -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 { |
@@ -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 |
@@ -375,6 +375,6 @@ discard block |
||
375 | 375 | } |
376 | 376 | |
377 | 377 | // Reset the sockets list |
378 | - $this->sockets = [ ]; |
|
378 | + $this->sockets = []; |
|
379 | 379 | } |
380 | 380 | } |