@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | public function __construct(array $config) |
29 | 29 | { |
30 | 30 | $this->handler = new Redis(); |
31 | - $redisConfig= $this::$defaults; |
|
31 | + $redisConfig = $this::$defaults; |
|
32 | 32 | foreach ($config as $key=>$value) { |
33 | 33 | $redisConfig[$key] = $value; |
34 | 34 | } |
35 | 35 | if (file_exists('igbinary_serialize')) { |
36 | 36 | $this->serializer = "IGBINARY"; |
37 | 37 | } |
38 | - if ( isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)) { |
|
38 | + if (isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)) { |
|
39 | 39 | return $this->persistentConnect($redisConfig); |
40 | 40 | } |
41 | 41 | return $this->connect($redisConfig); |
42 | 42 | } |
43 | 43 | |
44 | - private function connect( array $redisConfig) |
|
44 | + private function connect(array $redisConfig) |
|
45 | 45 | { |
46 | 46 | $this->handler->connect( |
47 | 47 | $redisConfig['host'], |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return $this->handler->select($redisConfig['dbIndex']); |
54 | 54 | } |
55 | 55 | |
56 | - private function persistentConnect( array $redisConfig) |
|
56 | + private function persistentConnect(array $redisConfig) |
|
57 | 57 | { |
58 | 58 | $this->handler->pconnect( |
59 | 59 | $redisConfig['host'], |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | { |
91 | 91 | $ttl = intval($ttl); |
92 | 92 | $value = $this->serialize($value); |
93 | - if($ttl ==0 ){ |
|
93 | + if ($ttl == 0) { |
|
94 | 94 | return $this->handler->set($key, $value); |
95 | 95 | } |
96 | 96 | return $this->handler->set($key, $value, $ttl); |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | return $this->handler->mSet($items); |
152 | 152 | } |
153 | 153 | |
154 | - $return =[]; |
|
154 | + $return = []; |
|
155 | 155 | foreach ($items as $key=>$value) { |
156 | - $return[$key] = $this->set($key, $value, $ttl); |
|
156 | + $return[$key] = $this->set($key, $value, $ttl); |
|
157 | 157 | } |
158 | 158 | return $return; |
159 | 159 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function deleteMultiple($keys) |
168 | 168 | { |
169 | - $return =[]; |
|
169 | + $return = []; |
|
170 | 170 | foreach ($keys as $key) { |
171 | 171 | $return[$key] = (bool) $this->delete($key); |
172 | 172 | } |