Completed
Branch v3 (0a2b4f)
by Austin
05:08
created
src/GameQ/Protocols/Ut3.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 
19 19
 namespace GameQ\Protocols;
20 20
 
21
-use GameQ\Buffer;
22 21
 use GameQ\Result;
23 22
 
24 23
 /**
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,8 +123,8 @@
 block discarded – undo
123 123
     /**
124 124
      * Dirty hack to delete result items
125 125
      *
126
-     * @param array $result
127
-     * @param array $array
126
+     * @param array string[]
127
+     * @param string[] $array
128 128
      */
129 129
     protected function deleteResult(array &$result, array $array)
130 130
     {
Please login to merge, or discard this patch.
src/GameQ/Filters/Base.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/GameQ/Protocols/Ase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/GameQ/Protocols/Bf3.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
     {
136 136
 
137 137
         // Holds the results sent back
138
-        $results = [ ];
138
+        $results = [];
139 139
 
140 140
         // Holds the processed packets after having been reassembled
141
-        $processed = [ ];
141
+        $processed = [];
142 142
 
143 143
         // Start up the index for the processed
144 144
         $sequence_id_last = 0;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             // Now we need to call the proper method
183 183
             $results = array_merge(
184 184
                 $results,
185
-                call_user_func_array([ $this, $this->responses[$sequence_id] ], [ $buffer ])
185
+                call_user_func_array([$this, $this->responses[$sequence_id]], [$buffer])
186 186
             );
187 187
         }
188 188
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     protected function decode(Buffer $buffer)
204 204
     {
205 205
 
206
-        $items = [ ];
206
+        $items = [];
207 207
 
208 208
         // Get the number of words in this buffer
209 209
         $itemCount = $buffer->readInt32();
Please login to merge, or discard this patch.
src/GameQ/Protocols/Cs16.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      * @return string
52 52
      * @throws \GameQ\Exception\Protocol
53 53
      */
54
-    protected function processPackets($packet_id, array $packets = [ ])
54
+    protected function processPackets($packet_id, array $packets = [])
55 55
     {
56 56
 
57 57
         // The response is gold source if the packets are split
Please login to merge, or discard this patch.
src/GameQ/Protocols/Gamespy3.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     {
108 108
 
109 109
         // Holds the processed packets
110
-        $processed = [ ];
110
+        $processed = [];
111 111
 
112 112
         // Iterate over the packets
113 113
         foreach ($this->packets_response as $response) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      *
170 170
      * @return array
171 171
      */
172
-    protected function cleanPackets(array $packets = [ ])
172
+    protected function cleanPackets(array $packets = [])
173 173
     {
174 174
 
175 175
         // Get the number of packets
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         /*
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
                 // Set the item group
290 290
                 $item_group = 'teams';
291 291
                 // Set the item type, rip off any trailing stuff and bad chars
292
-                $item_type = rtrim(str_replace([ "\x00", "\x02" ], '', $item), '_t');
292
+                $item_type = rtrim(str_replace(["\x00", "\x02"], '', $item), '_t');
293 293
             } else {
294 294
                 // We can assume it is data belonging to a previously defined item
295 295
 
Please login to merge, or discard this patch.
src/GameQ/Protocols/Mumble.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         // Let's iterate over the response items, there are a lot
136 136
         foreach ($data as $key => $value) {
137 137
             // Ignore root for now, that is where all of the channel/player info is housed
138
-            if (in_array($key, [ 'root' ])) {
138
+            if (in_array($key, ['root'])) {
139 139
                 continue;
140 140
             }
141 141
 
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
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
171 171
         foreach ($data as $key => $value) {
172 172
             // We will handle these later
173
-            if (in_array($key, [ 'channels', 'users' ])) {
173
+            if (in_array($key, ['channels', 'users'])) {
174 174
                 // skip
175 175
                 continue;
176 176
             }
Please login to merge, or discard this patch.
src/GameQ/Protocols/Samp.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/GameQ/Protocols/Starmade.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,11 +158,11 @@
 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
165
-        $parsed = [ ];
165
+        $parsed = [];
166 166
 
167 167
         // Read the number of parameters to parse
168 168
         $parameterSize = $buffer->readInt32Signed();
Please login to merge, or discard this patch.