@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function __construct(array $config) |
26 | 26 | { |
27 | - $this->handler= new \Redis(); |
|
28 | - $redisConfig= $this::$defaults; |
|
27 | + $this->handler = new \Redis(); |
|
28 | + $redisConfig = $this::$defaults; |
|
29 | 29 | foreach ($config as $key=>$value) { |
30 | 30 | $redisConfig[$key] = $value; |
31 | 31 | } |
32 | - if ( isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)) { |
|
32 | + if (isset($redisConfig['persistent']) && ($redisConfig['persistent'] === true)) { |
|
33 | 33 | $this->handler->connect( |
34 | 34 | $redisConfig['host'], |
35 | 35 | $redisConfig['port'], |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return bool True on success and false on failure |
71 | 71 | */ |
72 | - public function set($key, $value, $ttl = null){ |
|
72 | + public function set($key, $value, $ttl = null) { |
|
73 | 73 | $ttl = intval($ttl); |
74 | - if($ttl ==0 ){ |
|
74 | + if ($ttl == 0) { |
|
75 | 75 | return $this->handler->set($key, $value); |
76 | 76 | } |
77 | 77 | return $this->handler->set($key, $value, $ttl); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @return bool True on success and false on failure |
85 | 85 | */ |
86 | - public function delete($key){ |
|
86 | + public function delete($key) { |
|
87 | 87 | return (bool) $this->handler->delete($key); |
88 | 88 | } |
89 | 89 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return bool True on success and false on failure |
93 | 93 | */ |
94 | - public function clear(){ |
|
94 | + public function clear() { |
|
95 | 95 | return $this->handler->flushDb(); |
96 | 96 | } |
97 | 97 | /** |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | return $this->handler->mSet($items); |
121 | 121 | } |
122 | 122 | |
123 | - $return =[]; |
|
123 | + $return = []; |
|
124 | 124 | foreach ($items as $key=>$value) { |
125 | - $return[$key] = $this->set($key, $value, $ttl); |
|
125 | + $return[$key] = $this->set($key, $value, $ttl); |
|
126 | 126 | } |
127 | 127 | return $return; |
128 | 128 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function deleteMultiple($keys) |
137 | 137 | { |
138 | - $return =[]; |
|
138 | + $return = []; |
|
139 | 139 | foreach ($keys as $key) { |
140 | 140 | $return[$key] = (bool) $this->delete($key); |
141 | 141 | } |