Completed
Pull Request — master (#11)
by
unknown
02:38
created
src/Redis/Redis.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
         // TODO patch missing pub/sub, pipeline, auth
145 145
         $this->handleStart();
146
-        $this->emit('start', [ $this ]);
146
+        $this->emit('start', [$this]);
147 147
 
148 148
         return true;
149 149
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
          // TODO patch missing pub/sub, pipeline, auth
176 176
         $this->handleStop();
177
-        $this->emit('stop', [ $this ]);
177
+        $this->emit('stop', [$this]);
178 178
 
179 179
         return true;
180 180
     }
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
     {
227 227
         if ($this->stream !== null)
228 228
         {
229
-            $this->stream->on('data', [ $this, 'handleData' ]);
230
-            $this->stream->on('close', [ $this, 'stop' ]);
229
+            $this->stream->on('data', [$this, 'handleData']);
230
+            $this->stream->on('close', [$this, 'stop']);
231 231
         }
232 232
     }
233 233
 
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
     {
239 239
         if ($this->stream !== null)
240 240
         {
241
-            $this->stream->removeListener('data', [ $this, 'handleData' ]);
242
-            $this->stream->removeListener('close', [ $this, 'stop' ]);
241
+            $this->stream->removeListener('data', [$this, 'handleData']);
242
+            $this->stream->removeListener('close', [$this, 'stop']);
243 243
         }
244 244
     }
245 245
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         }
257 257
         catch (ParserException $error)
258 258
         {
259
-            $this->emit('error', [ $this, $error ]);
259
+            $this->emit('error', [$this, $error]);
260 260
             $this->stop();
261 261
             return;
262 262
         }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             }
270 270
             catch (UnderflowException $error)
271 271
             {
272
-                $this->emit('error', [ $this, $error ]);
272
+                $this->emit('error', [$this, $error]);
273 273
                 $this->stop();
274 274
                 return;
275 275
             }
Please login to merge, or discard this patch.
src/Redis/Command/Api/ApiConnInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      * @param string $message
19 19
      * @return mixed
20 20
      */
21
-    public function ping($message='pong');
21
+    public function ping($message = 'pong');
22 22
 
23 23
     /**
24 24
      * @doc https://redis.io/commands/quit
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiSetHashTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,13 +48,13 @@
 block discarded – undo
48 48
         $command = Enum::HGETALL;
49 49
         $args = [$key];
50 50
 
51
-        return $this->dispatch(Builder::build($command, $args))->then(function ($value) {
51
+        return $this->dispatch(Builder::build($command, $args))->then(function($value) {
52 52
             if (!empty($value)) {
53 53
                 $tmp = [];
54 54
                 $size = count($value);
55
-                for ($i=0; $i<$size; $i+=2) {
55
+                for ($i = 0; $i < $size; $i += 2) {
56 56
                     $field = $value[$i];
57
-                    $val = $value[$i+1];
57
+                    $val = $value[$i + 1];
58 58
                     $tmp[$field] = $val;
59 59
                 }
60 60
                 $value = $tmp;
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiGeospatialTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     {
61 61
         // TODO: Implement geoDist() method.
62 62
         $command = Enum::GEODIST;
63
-        $args = [$key, $memberA, $memberB ,$unit];
63
+        $args = [$key, $memberA, $memberB, $unit];
64 64
 
65 65
         return $this->dispatch(Builder::build($command, $args));
66 66
     }
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiKeyValTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
      * @override
348 348
      * @inheritDoc
349 349
      */
350
-    public function del($key,...$keys)
350
+    public function del($key, ...$keys)
351 351
     {
352 352
         $command = Enum::DEL;
353 353
         $keys[] = $key;
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiListTrait.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
         $keys[] = $timeout;
26 26
         $args = $keys;
27 27
         $promise = $this->dispatch(Builder::build($command, $args));
28
-        $promise = $promise->then(function ($value) {
28
+        $promise = $promise->then(function($value) {
29 29
             if (is_array($value)) {
30
-                list($k,$v) = $value;
30
+                list($k, $v) = $value;
31 31
 
32 32
                 return [
33 33
                     'key'=>$k,
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
         $keys[] = $timeout;
53 53
         $args = $keys;
54 54
         $promise = $this->dispatch(Builder::build($command, $args));
55
-        $promise = $promise->then(function ($value) {
55
+        $promise = $promise->then(function($value) {
56 56
             if (is_array($value)) {
57
-                list($k,$v) = $value;
57
+                list($k, $v) = $value;
58 58
 
59 59
                 return [
60 60
                     'key'=>$k,
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      * @override
138 138
      * @inheritDoc
139 139
      */
140
-    public function lPush($key,...$values)
140
+    public function lPush($key, ...$values)
141 141
     {
142 142
         $command = Enum::LPUSH;
143 143
         array_unshift($values, $key);
Please login to merge, or discard this patch.
src/Redis/Command/Api/ApiKeyValInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @param int $end
22 22
      * @return mixed
23 23
      */
24
-    public function bitCount($key, $start=0, $end=-1);
24
+    public function bitCount($key, $start = 0, $end = -1);
25 25
 
26 26
     /**
27 27
      * @doc https://redis.io/commands/bitfield
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @param int $end
53 53
      * @return mixed
54 54
      */
55
-    public function bitPos($key, $bit, $start=0, $end=-1);
55
+    public function bitPos($key, $bit, $start = 0, $end = -1);
56 56
 
57 57
     /**
58 58
      * @doc https://redis.io/commands/decr
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiSetTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     public function sIsMember($key, $member)
60 60
     {
61 61
         $command = Enum::SISMEMBER;
62
-        $args = [$key ,$member];
62
+        $args = [$key, $member];
63 63
 
64 64
         return $this->dispatch(Builder::build($command, $args));
65 65
     }
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiSetSortedTrait.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
         $args = [$key, $star, $stop];
97 97
         if ($withScores) {
98 98
             $args[] = 'WITHSCORES';
99
-            return $this->dispatch(Builder::build($command, $args))->then(function ($value) {
99
+            return $this->dispatch(Builder::build($command, $args))->then(function($value) {
100 100
                 $len = count($value);
101 101
                 $ret = [];
102
-                for ($i=0; $i<$len; $i+=2) {
103
-                    $ret[$value[$i]] = $value[$i+1];
102
+                for ($i = 0; $i < $len; $i += 2) {
103
+                    $ret[$value[$i]] = $value[$i + 1];
104 104
                 }
105 105
                 return $ret;
106 106
             });
@@ -129,8 +129,8 @@  discard block
 block discarded – undo
129 129
     public function zRevRangeByLex($key, $max, $min, array $options = [])
130 130
     {
131 131
         $command = Enum::ZREVRANGEBYLEX;
132
-        $args = [$key, $max,$min];
133
-        $args = array_merge($args,$options);
132
+        $args = [$key, $max, $min];
133
+        $args = array_merge($args, $options);
134 134
 
135 135
         return $this->dispatch(Builder::build($command, $args));
136 136
     }
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
         }
154 154
         $promise = $this->dispatch(Builder::build($command, $args));
155 155
 
156
-        return $withScores ? $promise->then(function ($value) {
156
+        return $withScores ? $promise->then(function($value) {
157 157
             $len = is_array($value) ? count($value) : 0;
158 158
             if ($len > 0) {
159 159
                 $ret = [];
160
-                for ($i=0; $i<$len; $i+=2) {
161
-                    $ret[$value[$i]] = $value[$i+1];
160
+                for ($i = 0; $i < $len; $i += 2) {
161
+                    $ret[$value[$i]] = $value[$i + 1];
162 162
                 }
163 163
 
164 164
                 return $ret;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     public function zRank($key, $member)
176 176
     {
177 177
         $command = Enum::ZRANK;
178
-        $args = [$key,$member];
178
+        $args = [$key, $member];
179 179
 
180 180
         return $this->dispatch(Builder::build($command, $args));
181 181
     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     public function zRemRangeByRank($key, $start, $stop)
214 214
     {
215 215
         $command = Enum::ZREMRANGEBYRANK;
216
-        $args = [$key, $start,$stop];
216
+        $args = [$key, $start, $stop];
217 217
 
218 218
         return $this->dispatch(Builder::build($command, $args));
219 219
     }
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
             $args[] = 'WITHSCORES';
245 245
             
246 246
             return $this->dispatch(Builder::build($command, $args))
247
-            ->then(function ($value) {
247
+            ->then(function($value) {
248 248
                 $len = is_array($value) ? count($value) : 0;
249 249
                 if ($len > 0) {
250 250
                     $ret = [];
251
-                    for ($i=0; $i<$len; $i+=2) {
251
+                    for ($i = 0; $i < $len; $i += 2) {
252 252
                         $member = $value[$i];
253
-                        $score = $value[$i+1];
253
+                        $score = $value[$i + 1];
254 254
                         $ret[$member] = $score;
255 255
                     }
256 256
 
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
         }
283 283
         $promise = $this->dispatch(Builder::build($command, $args));
284 284
 
285
-        return $withScores ? $promise->then(function ($value) {
285
+        return $withScores ? $promise->then(function($value) {
286 286
             $len = is_array($value) ? count($value) : 0;
287 287
             if ($len > 0) {
288 288
                 $ret = [];
289
-                for ($i=0; $i<$len; $i+=2) {
290
-                    $ret[$value[$i]] = $value[$i+1];
289
+                for ($i = 0; $i < $len; $i += 2) {
290
+                    $ret[$value[$i]] = $value[$i + 1];
291 291
                 }
292 292
 
293 293
                 return $ret;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     public function zRevRank($key, $member)
305 305
     {
306 306
         $command = Enum::ZREVRANK;
307
-        $args = [$key,$member];
307
+        $args = [$key, $member];
308 308
 
309 309
         return $this->dispatch(Builder::build($command, $args));
310 310
     }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     public function zScore($key, $member)
317 317
     {
318 318
         $command = Enum::ZSCORE;
319
-        $args = [$key,$member];
319
+        $args = [$key, $member];
320 320
 
321 321
         return $this->dispatch(Builder::build($command, $args));
322 322
     }
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
     public function zScan($key, $cursor, array $options = [])
329 329
     {
330 330
         $command = Enum::ZSCAN;
331
-        $args = [$key , $cursor];
331
+        $args = [$key, $cursor];
332 332
         $args = array_merge($args, $options);
333 333
 
334 334
         return $this->dispatch(Builder::build($command, $args));
Please login to merge, or discard this patch.