@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $args = [$key, $star, $stop]; |
104 | 104 | if ($withScores) { |
105 | 105 | $args[] = 'WITHSCORES'; |
106 | - return $this->dispatch(Builder::build($command, $args))->then(function ($value) { |
|
106 | + return $this->dispatch(Builder::build($command, $args))->then(function($value) { |
|
107 | 107 | $len = count($value); |
108 | 108 | $ret = []; |
109 | - for ($i=0; $i<$len; $i+=2) { |
|
110 | - $ret[$value[$i]] = $value[$i+1]; |
|
109 | + for ($i = 0; $i < $len; $i += 2) { |
|
110 | + $ret[$value[$i]] = $value[$i + 1]; |
|
111 | 111 | } |
112 | 112 | return $ret; |
113 | 113 | }); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $command = Enum::ZRANGEBYLEX; |
126 | 126 | $args = [$key, $min, $max]; |
127 | - $args = array_merge($args,$options); |
|
127 | + $args = array_merge($args, $options); |
|
128 | 128 | |
129 | 129 | return $this->dispatch(Builder::build($command, $args)); |
130 | 130 | } |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | public function zRevRangeByLex($key, $max, $min, array $options = []) |
137 | 137 | { |
138 | 138 | $command = Enum::ZREVRANGEBYLEX; |
139 | - $args = [$key, $max,$min]; |
|
140 | - $args = array_merge($args,$options); |
|
139 | + $args = [$key, $max, $min]; |
|
140 | + $args = array_merge($args, $options); |
|
141 | 141 | |
142 | 142 | return $this->dispatch(Builder::build($command, $args)); |
143 | 143 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function zRangeByScore($key, $min, $max, array $options = []) |
150 | 150 | { |
151 | 151 | $command = Enum::ZRANGEBYSCORE; |
152 | - $args = [$key, $min,$max]; |
|
152 | + $args = [$key, $min, $max]; |
|
153 | 153 | $args = array_merge($args, $options); |
154 | 154 | |
155 | 155 | return $this->dispatch(Builder::build($command, $args)); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function zRank($key, $member) |
163 | 163 | { |
164 | 164 | $command = Enum::ZRANK; |
165 | - $args = [$key,$member]; |
|
165 | + $args = [$key, $member]; |
|
166 | 166 | |
167 | 167 | return $this->dispatch(Builder::build($command, $args)); |
168 | 168 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | public function zRemRangeByRank($key, $start, $stop) |
201 | 201 | { |
202 | 202 | $command = Enum::ZREMRANGEBYRANK; |
203 | - $args = [$key, $start,$stop]; |
|
203 | + $args = [$key, $start, $stop]; |
|
204 | 204 | |
205 | 205 | return $this->dispatch(Builder::build($command, $args)); |
206 | 206 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | public function zRevRangeByScore($key, $max, $min, array $options = []) |
239 | 239 | { |
240 | 240 | $command = Enum::ZREVRANGEBYSCORE; |
241 | - $args = [$key,$max,$min]; |
|
241 | + $args = [$key, $max, $min]; |
|
242 | 242 | $args = array_merge($args, $options); |
243 | 243 | |
244 | 244 | return $this->dispatch(Builder::build($command, $args)); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | public function zRevRank($key, $member) |
252 | 252 | { |
253 | 253 | $command = Enum::ZREVRANK; |
254 | - $args = [$key,$member]; |
|
254 | + $args = [$key, $member]; |
|
255 | 255 | |
256 | 256 | return $this->dispatch(Builder::build($command, $args)); |
257 | 257 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | public function zScore($key, $member) |
264 | 264 | { |
265 | 265 | $command = Enum::ZSCORE; |
266 | - $args = [$key,$member]; |
|
266 | + $args = [$key, $member]; |
|
267 | 267 | |
268 | 268 | return $this->dispatch(Builder::build($command, $args)); |
269 | 269 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | // TODO: Implement zScan() method. |
278 | 278 | $command = Enum::ZSCAN; |
279 | - $args = [$key , $cursor]; |
|
279 | + $args = [$key, $cursor]; |
|
280 | 280 | $args = array_merge($args, $options); |
281 | 281 | |
282 | 282 | return $this->dispatch(Builder::build($command, $args)); |
@@ -22,8 +22,10 @@ discard block |
||
22 | 22 | { |
23 | 23 | $command = Enum::ZADD; |
24 | 24 | $args = array_merge([$key], $options); |
25 | - if (!empty($scoreMembers)) { |
|
26 | - foreach ($scoreMembers as $score => $member) { |
|
25 | + if (!empty($scoreMembers)) |
|
26 | + { |
|
27 | + foreach ($scoreMembers as $score => $member) |
|
28 | + { |
|
27 | 29 | $args[] = (float) $score; |
28 | 30 | $args[] = $member; |
29 | 31 | } |
@@ -101,12 +103,14 @@ discard block |
||
101 | 103 | { |
102 | 104 | $command = Enum::ZRANGE; |
103 | 105 | $args = [$key, $star, $stop]; |
104 | - if ($withScores) { |
|
106 | + if ($withScores) |
|
107 | + { |
|
105 | 108 | $args[] = 'WITHSCORES'; |
106 | 109 | return $this->dispatch(Builder::build($command, $args))->then(function ($value) { |
107 | 110 | $len = count($value); |
108 | 111 | $ret = []; |
109 | - for ($i=0; $i<$len; $i+=2) { |
|
112 | + for ($i=0; $i<$len; $i+=2) |
|
113 | + { |
|
110 | 114 | $ret[$value[$i]] = $value[$i+1]; |
111 | 115 | } |
112 | 116 | return $ret; |
@@ -66,7 +66,6 @@ |
||
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); |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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 |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | public function bitField($key, $subCommand = null, ...$param) |
46 | 46 | { |
47 | 47 | $command = Enum::BITFIELD; |
48 | - switch ($subCommand = strtoupper($subCommand)) { |
|
48 | + switch ($subCommand = strtoupper($subCommand)) |
|
49 | + { |
|
49 | 50 | case 'GET' : { |
50 | 51 | list ($type, $offset) = $param; |
51 | 52 | $args = [$subCommand, $type, $offset]; |
@@ -303,8 +304,10 @@ discard block |
||
303 | 304 | { |
304 | 305 | $command = Enum::MSET; |
305 | 306 | $args = []; |
306 | - if (!empty($kvMap)) { |
|
307 | - foreach ($kvMap as $key => $val) { |
|
307 | + if (!empty($kvMap)) |
|
308 | + { |
|
309 | + foreach ($kvMap as $key => $val) |
|
310 | + { |
|
308 | 311 | $args[] = $key; |
309 | 312 | $args[] = $val; |
310 | 313 | } |
@@ -321,8 +324,10 @@ discard block |
||
321 | 324 | { |
322 | 325 | $command = Enum::MSETNX; |
323 | 326 | $args = []; |
324 | - if (!empty($kvMap)) { |
|
325 | - foreach ($kvMap as $key => $val) { |
|
327 | + if (!empty($kvMap)) |
|
328 | + { |
|
329 | + foreach ($kvMap as $key => $val) |
|
330 | + { |
|
326 | 331 | $args[] = $key; |
327 | 332 | $args[] = $val; |
328 | 333 | } |