@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | * @method string decrby(string $key, int $decrement) |
| 66 | 66 | * @method string set(string $key, string $value) |
| 67 | 67 | */ |
| 68 | -class RedisClient |
|
| 69 | -{ |
|
| 68 | +class RedisClient { |
|
| 70 | 69 | /** |
| 71 | 70 | * The connection socket |
| 72 | 71 | * line length not limited |
@@ -123,7 +122,8 @@ discard block |
||
| 123 | 122 | throw new RuntimeException(sprintf('Redis socket return error: %s', $result)); |
| 124 | 123 | } |
| 125 | 124 | |
| 126 | - if ($type === '$') { // bulk reply |
|
| 125 | + if ($type === '$') { |
|
| 126 | +// bulk reply |
|
| 127 | 127 | if ($result === '-1') { |
| 128 | 128 | $result = null; |
| 129 | 129 | } else { |
@@ -135,7 +135,8 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | $result = substr($line, 0, strlen($line) - 2); |
| 137 | 137 | } |
| 138 | - } elseif ($type === '*') { // multi-bulk reply |
|
| 138 | + } elseif ($type === '*') { |
|
| 139 | +// multi-bulk reply |
|
| 139 | 140 | $count = (int) $result; |
| 140 | 141 | for ($i = 0 , $result = []; $i < $count; $i++) { |
| 141 | 142 | $result[] = $this->getResponse(); |
@@ -150,8 +151,7 @@ discard block |
||
| 150 | 151 | * @return resource |
| 151 | 152 | * @throws RuntimeException |
| 152 | 153 | */ |
| 153 | - protected function getSocket() |
|
| 154 | - { |
|
| 154 | + protected function getSocket() { |
|
| 155 | 155 | if (is_resource($this->socket)) { |
| 156 | 156 | return $this->socket; |
| 157 | 157 | } |