@@ -147,10 +147,10 @@ |
||
147 | 147 | { |
148 | 148 | try{ |
149 | 149 | $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [ |
150 | - 'host' => "127.0.0.1", |
|
151 | - 'port' => 8888, |
|
152 | - 'password' => '', |
|
153 | - 'timeout' => 2000, |
|
150 | + 'host' => "127.0.0.1", |
|
151 | + 'port' => 8888, |
|
152 | + 'password' => '', |
|
153 | + 'timeout' => 2000, |
|
154 | 154 | ]; |
155 | 155 | |
156 | 156 | $host = $server[ 'host' ]; |
@@ -145,18 +145,18 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function driverConnect() |
147 | 147 | { |
148 | - try{ |
|
149 | - $server = isset($this->config[ 'ssdb' ]) ? $this->config[ 'ssdb' ] : [ |
|
148 | + try { |
|
149 | + $server = isset($this->config['ssdb']) ? $this->config['ssdb'] : [ |
|
150 | 150 | 'host' => "127.0.0.1", |
151 | 151 | 'port' => 8888, |
152 | 152 | 'password' => '', |
153 | 153 | 'timeout' => 2000, |
154 | 154 | ]; |
155 | 155 | |
156 | - $host = $server[ 'host' ]; |
|
157 | - $port = isset($server[ 'port' ]) ? (int) $server[ 'port' ] : 8888; |
|
158 | - $password = isset($server[ 'password' ]) ? $server[ 'password' ] : ''; |
|
159 | - $timeout = !empty($server[ 'timeout' ]) ? (int) $server[ 'timeout' ] : 2000; |
|
156 | + $host = $server['host']; |
|
157 | + $port = isset($server['port']) ? (int) $server['port'] : 8888; |
|
158 | + $password = isset($server['password']) ? $server['password'] : ''; |
|
159 | + $timeout = !empty($server['timeout']) ? (int) $server['timeout'] : 2000; |
|
160 | 160 | $this->instance = new SimpleSSDB($host, $port, $timeout); |
161 | 161 | if (!empty($password)) { |
162 | 162 | $this->instance->auth($password); |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | } else { |
168 | 168 | return true; |
169 | 169 | } |
170 | - }catch(SSDBException $e){ |
|
171 | - throw new phpFastCacheDriverException('Ssdb failed to connect with error: '. $e->getMessage(), 0 , $e); |
|
170 | + } catch (SSDBException $e) { |
|
171 | + throw new phpFastCacheDriverException('Ssdb failed to connect with error: ' . $e->getMessage(), 0, $e); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 |
@@ -167,7 +167,7 @@ |
||
167 | 167 | } else { |
168 | 168 | return true; |
169 | 169 | } |
170 | - }catch(SSDBException $e){ |
|
170 | + } catch(SSDBException $e){ |
|
171 | 171 | throw new phpFastCacheDriverException('Ssdb failed to connect with error: '. $e->getMessage(), 0 , $e); |
172 | 172 | } |
173 | 173 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | |
116 | 116 | |
117 | 117 | /** |
118 | - * @param $file |
|
118 | + * @param string $file |
|
119 | 119 | * @return string |
120 | 120 | * @throws \Exception |
121 | 121 | */ |
@@ -214,9 +214,9 @@ |
||
214 | 214 | public function driverPreWrap(ExtendedCacheItemInterface $item) |
215 | 215 | { |
216 | 216 | return [ |
217 | - self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
218 | - self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(), |
|
219 | - self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
217 | + self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
218 | + self::DRIVER_TIME_WRAPPER_INDEX => $item->getExpirationDate(), |
|
219 | + self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
220 | 220 | ]; |
221 | 221 | } |
222 | 222 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (is_array($config_name)) { |
66 | 66 | $this->config = array_merge($this->config, $config_name); |
67 | 67 | } else { |
68 | - $this->config[ $config_name ] = $value; |
|
68 | + $this->config[$config_name] = $value; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function driverUnwrapData(array $wrapper) |
184 | 184 | { |
185 | - return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ]; |
|
185 | + return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX]; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function driverUnwrapTags(array $wrapper) |
193 | 193 | { |
194 | - return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ]; |
|
194 | + return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX]; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function driverUnwrapTime(array $wrapper) |
203 | 203 | { |
204 | - return $wrapper[ self::DRIVER_TIME_WRAPPER_INDEX ]; |
|
204 | + return $wrapper[self::DRIVER_TIME_WRAPPER_INDEX]; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | foreach ($tagsItems as $tagsItem) { |
256 | 256 | $data = (array) $tagsItem->get(); |
257 | 257 | |
258 | - unset($data[ $item->getKey() ]); |
|
258 | + unset($data[$item->getKey()]); |
|
259 | 259 | $tagsItem->set($data); |
260 | 260 | |
261 | 261 | /** |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | */ |
307 | 307 | public static function isValidOption($optionName, $optionValue) |
308 | 308 | { |
309 | - if(!is_string($optionName)) |
|
309 | + if (!is_string($optionName)) |
|
310 | 310 | { |
311 | 311 | throw new \InvalidArgumentException('$optionName must be a string'); |
312 | 312 | } |