Completed
Pull Request — master (#12)
by
unknown
03:18
created
src/Redis/Driver/DriverInterface.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -6,5 +6,8 @@
 block discarded – undo
6 6
 
7 7
 interface DriverInterface
8 8
 {
9
+    /**
10
+     * @return string
11
+     */
9 12
     public function commands(Request $request);
10 13
 }
11 14
\ No newline at end of file
Please login to merge, or discard this patch.
src/Redis/Driver/RequestInterface.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,4 +5,5 @@
 block discarded – undo
5 5
 use Clue\Redis\Protocol\Model\ModelInterface as ClueModelInterface;
6 6
 
7 7
 interface RequestInterface extends ClueModelInterface
8
-{}
8
+{
9
+}
Please login to merge, or discard this patch.
src/Redis/Redis.php 2 patches
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -128,9 +128,11 @@  discard block
 block discarded – undo
128 128
             $stream = $this->createClient($this->endpoint);
129 129
         }
130 130
         catch (Error $ex)
131
-        {}
131
+        {
132
+}
132 133
         catch (Exception $ex)
133
-        {}
134
+        {
135
+}
134 136
 
135 137
         if ($ex !== null)
136 138
         {
@@ -320,9 +322,11 @@  discard block
 block discarded – undo
320 322
             return new Socket($endpoint, $this->loop);
321 323
         }
322 324
         catch (Error $ex)
323
-        {}
325
+        {
326
+}
324 327
         catch (Exception $ex)
325
-        {}
328
+        {
329
+}
326 330
 
327 331
         throw new ExecutionException('Redis connection socket could not be created!', 0, $ex);
328 332
     }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $this->isBeingDisconnected = false;
142 142
         $this->stream = $stream;
143 143
         $this->handleStart();
144
-        $this->emit('start', [ $this ]);
144
+        $this->emit('start', [$this]);
145 145
 
146 146
         return true;
147 147
     }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
         $this->reqs = [];
172 172
         $this->handleStop();
173
-        $this->emit('stop', [ $this ]);
173
+        $this->emit('stop', [$this]);
174 174
 
175 175
         return true;
176 176
     }
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
     {
223 223
         if ($this->stream !== null)
224 224
         {
225
-            $this->stream->on('data', [ $this, 'handleData' ]);
226
-            $this->stream->on('close', [ $this, 'stop' ]);
225
+            $this->stream->on('data', [$this, 'handleData']);
226
+            $this->stream->on('close', [$this, 'stop']);
227 227
         }
228 228
     }
229 229
 
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
     {
235 235
         if ($this->stream !== null)
236 236
         {
237
-            $this->stream->removeListener('data', [ $this, 'handleData' ]);
238
-            $this->stream->removeListener('close', [ $this, 'stop' ]);
237
+            $this->stream->removeListener('data', [$this, 'handleData']);
238
+            $this->stream->removeListener('close', [$this, 'stop']);
239 239
         }
240 240
     }
241 241
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         }
253 253
         catch (ParserException $error)
254 254
         {
255
-            $this->emit('error', [ $this, $error ]);
255
+            $this->emit('error', [$this, $error]);
256 256
             $this->stop();
257 257
             return;
258 258
         }
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             }
266 266
             catch (UnderflowException $error)
267 267
             {
268
-                $this->emit('error', [ $this, $error ]);
268
+                $this->emit('error', [$this, $error]);
269 269
                 $this->stop();
270 270
                 return;
271 271
             }
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 2 patches
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.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,10 +49,12 @@  discard block
 block discarded – undo
49 49
         $args = [$key];
50 50
 
51 51
         return $this->dispatch(Builder::build($command, $args))->then(function ($value) {
52
-            if (!empty($value)) {
52
+            if (!empty($value))
53
+            {
53 54
                 $tmp = [];
54 55
                 $size = count($value);
55
-                for ($i=0; $i<$size; $i+=2) {
56
+                for ($i=0; $i<$size; $i+=2)
57
+                {
56 58
                     $field = $value[$i];
57 59
                     $val = $value[$i+1];
58 60
                     $tmp[$field] = $val;
@@ -134,8 +136,10 @@  discard block
 block discarded – undo
134 136
         //TODO: replace param $fvMap to ...$fvs,cauz hash map not allow duplicate key
135 137
         $command = Enum::HMSET;
136 138
         $args = [$key];
137
-        if (!empty($fvMap)) {
138
-            foreach ($fvMap as $field => $value) {
139
+        if (!empty($fvMap))
140
+        {
141
+            foreach ($fvMap as $field => $value)
142
+            {
139 143
                 $tmp[] = $field;
140 144
                 $tmp[] = $value;
141 145
             }
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 2 patches
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.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,8 @@  discard block
 block discarded – undo
47 47
         $command = Enum::BITFIELD;
48 48
         $subCommand = strtoupper($subCommand);
49 49
         //TODO: control flow improvement
50
-        switch ($subCommand) {
50
+        switch ($subCommand)
51
+        {
51 52
             case 'GET' : {
52 53
                 @list ($type, $offset) = $param;
53 54
                 $args = [$key, $subCommand, $type, $offset];
@@ -305,8 +306,10 @@  discard block
 block discarded – undo
305 306
         //TODO: change the param $kvMap to ...$kv,cauz map not allow duplicate key
306 307
         $command = Enum::MSET;
307 308
         $args = [];
308
-        if (!empty($kvMap)) {
309
-            foreach ($kvMap as $key => $val) {
309
+        if (!empty($kvMap))
310
+        {
311
+            foreach ($kvMap as $key => $val)
312
+            {
310 313
                 $args[] = $key;
311 314
                 $args[] = $val;
312 315
             }
@@ -323,8 +326,10 @@  discard block
 block discarded – undo
323 326
     {
324 327
         $command = Enum::MSETNX;
325 328
         $args = [];
326
-        if (!empty($kvMap)) {
327
-            foreach ($kvMap as $key => $val) {
329
+        if (!empty($kvMap))
330
+        {
331
+            foreach ($kvMap as $key => $val)
332
+            {
328 333
                 $args[] = $key;
329 334
                 $args[] = $val;
330 335
             }
Please login to merge, or discard this patch.
src/Redis/Command/Compose/ApiListTrait.php 2 patches
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.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@  discard block
 block discarded – undo
26 26
         $args = $keys;
27 27
         $promise = $this->dispatch(Builder::build($command, $args));
28 28
         $promise = $promise->then(function ($value) {
29
-            if (is_array($value)) {
29
+            if (is_array($value))
30
+            {
30 31
                 list($k,$v) = $value;
31 32
 
32 33
                 return [
@@ -53,7 +54,8 @@  discard block
 block discarded – undo
53 54
         $args = $keys;
54 55
         $promise = $this->dispatch(Builder::build($command, $args));
55 56
         $promise = $promise->then(function ($value) {
56
-            if (is_array($value)) {
57
+            if (is_array($value))
58
+            {
57 59
                 list($k,$v) = $value;
58 60
 
59 61
                 return [
Please login to merge, or discard this patch.
src/Redis/Command/Api/ApiSetSortedInterface.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,6 @@
 block discarded – undo
66 66
      * @param $key
67 67
      * @param $star
68 68
      * @param $stop
69
-     * @param array $options
70 69
      * @return mixed
71 70
      */
72 71
     public function zRange($key, $star = 0, $stop = -1, $withScores = false);
Please login to merge, or discard this patch.