@@ -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 |
@@ -95,12 +95,14 @@ discard block |
||
95 | 95 | { |
96 | 96 | $command = Enum::ZRANGE; |
97 | 97 | $args = [$key, $star, $stop]; |
98 | - if ($withScores) { |
|
98 | + if ($withScores) |
|
99 | + { |
|
99 | 100 | $args[] = 'WITHSCORES'; |
100 | 101 | return $this->dispatch(Builder::build($command, $args))->then(function ($value) { |
101 | 102 | $len = count($value); |
102 | 103 | $ret = []; |
103 | - for ($i=0; $i<$len; $i+=2) { |
|
104 | + for ($i=0; $i<$len; $i+=2) |
|
105 | + { |
|
104 | 106 | $ret[$value[$i]] = $value[$i+1]; |
105 | 107 | } |
106 | 108 | return $ret; |
@@ -144,10 +146,12 @@ discard block |
||
144 | 146 | { |
145 | 147 | $command = Enum::ZRANGEBYSCORE; |
146 | 148 | $args = [$key, $min, $max]; |
147 | - if ($withScores === true) { |
|
149 | + if ($withScores === true) |
|
150 | + { |
|
148 | 151 | $args[] = 'WITHSCORES'; |
149 | 152 | } |
150 | - if ($offset != 0 || $count != 0) { |
|
153 | + if ($offset != 0 || $count != 0) |
|
154 | + { |
|
151 | 155 | $args[] = 'LIMIT'; |
152 | 156 | $args[] = $offset; |
153 | 157 | $args[] = $count; |
@@ -156,9 +160,11 @@ discard block |
||
156 | 160 | |
157 | 161 | return $withScores ? $promise->then(function ($value) { |
158 | 162 | $len = is_array($value) ? count($value) : 0; |
159 | - if ($len > 0) { |
|
163 | + if ($len > 0) |
|
164 | + { |
|
160 | 165 | $ret = []; |
161 | - for ($i=0; $i<$len; $i+=2) { |
|
166 | + for ($i=0; $i<$len; $i+=2) |
|
167 | + { |
|
162 | 168 | $ret[$value[$i]] = $value[$i+1]; |
163 | 169 | } |
164 | 170 | |
@@ -241,15 +247,18 @@ discard block |
||
241 | 247 | $command = Enum::ZREVRANGE; |
242 | 248 | $args = [$key, $start, $stop]; |
243 | 249 | |
244 | - if ($withScores === true) { |
|
250 | + if ($withScores === true) |
|
251 | + { |
|
245 | 252 | $args[] = 'WITHSCORES'; |
246 | 253 | |
247 | 254 | return $this->dispatch(Builder::build($command, $args)) |
248 | 255 | ->then(function ($value) { |
249 | 256 | $len = is_array($value) ? count($value) : 0; |
250 | - if ($len > 0) { |
|
257 | + if ($len > 0) |
|
258 | + { |
|
251 | 259 | $ret = []; |
252 | - for ($i=0; $i<$len; $i+=2) { |
|
260 | + for ($i=0; $i<$len; $i+=2) |
|
261 | + { |
|
253 | 262 | $member = $value[$i]; |
254 | 263 | $score = $value[$i+1]; |
255 | 264 | $ret[$member] = $score; |
@@ -273,10 +282,12 @@ discard block |
||
273 | 282 | { |
274 | 283 | $command = Enum::ZREVRANGEBYSCORE; |
275 | 284 | $args = [$key, $max, $min]; |
276 | - if ($withScores === true) { |
|
285 | + if ($withScores === true) |
|
286 | + { |
|
277 | 287 | $args[] = 'WITHSCORES'; |
278 | 288 | } |
279 | - if ($offset != 0 || $count != 0) { |
|
289 | + if ($offset != 0 || $count != 0) |
|
290 | + { |
|
280 | 291 | $args[] = 'LIMIT'; |
281 | 292 | $args[] = $offset; |
282 | 293 | $args[] = $count; |
@@ -285,9 +296,11 @@ discard block |
||
285 | 296 | |
286 | 297 | return $withScores ? $promise->then(function ($value) { |
287 | 298 | $len = is_array($value) ? count($value) : 0; |
288 | - if ($len > 0) { |
|
299 | + if ($len > 0) |
|
300 | + { |
|
289 | 301 | $ret = []; |
290 | - for ($i=0; $i<$len; $i+=2) { |
|
302 | + for ($i=0; $i<$len; $i+=2) |
|
303 | + { |
|
291 | 304 | $ret[$value[$i]] = $value[$i+1]; |
292 | 305 | } |
293 | 306 |
@@ -96,11 +96,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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)); |
@@ -59,7 +59,7 @@ |
||
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 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | * @param array $args |
84 | 84 | * @return mixed |
85 | 85 | */ |
86 | - public function slowLog($subCommand, array $args=[]); |
|
86 | + public function slowLog($subCommand, array $args = []); |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @doc https://redis.io/commands/save |