@@ -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 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (is_array($config_name)) { |
68 | 68 | $this->config = array_merge($this->config, $config_name); |
69 | 69 | } else { |
70 | - $this->config[ $config_name ] = $value; |
|
70 | + $this->config[$config_name] = $value; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function driverUnwrapData(array $wrapper) |
186 | 186 | { |
187 | - return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ]; |
|
187 | + return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX]; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | public function driverUnwrapTags(array $wrapper) |
195 | 195 | { |
196 | - return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ]; |
|
196 | + return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX]; |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function driverUnwrapTime(array $wrapper) |
205 | 205 | { |
206 | - return $wrapper[ self::DRIVER_TIME_WRAPPER_INDEX ]; |
|
206 | + return $wrapper[self::DRIVER_TIME_WRAPPER_INDEX]; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | foreach ($tagsItems as $tagsItem) { |
258 | 258 | $data = (array) $tagsItem->get(); |
259 | 259 | |
260 | - unset($data[ $item->getKey() ]); |
|
260 | + unset($data[$item->getKey()]); |
|
261 | 261 | $tagsItem->set($data); |
262 | 262 | |
263 | 263 | /** |