@@ -6,5 +6,8 @@ |
||
| 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 |
@@ -18,7 +18,7 @@ |
||
| 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 |
@@ -48,13 +48,13 @@ |
||
| 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; |
@@ -60,7 +60,7 @@ |
||
| 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 | } |
@@ -347,7 +347,7 @@ |
||
| 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; |
@@ -25,9 +25,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -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 |
@@ -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 | } |