@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $return = []; |
121 | 121 | |
122 | - foreach ($data as $scoped_key => $value) { |
|
122 | + foreach ( $data as $scoped_key => $value ) { |
|
123 | 123 | $key = substr($scoped_key, strlen("$scope-")); |
124 | 124 | $return[$key] = $value; |
125 | 125 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $shadowNames = []; |
142 | 142 | |
143 | - foreach ($key_values as $key => $value) { |
|
143 | + foreach ( $key_values as $key => $value ) { |
|
144 | 144 | $shadowNames["$scope-$key"] = $value; |
145 | 145 | } |
146 | 146 |
@@ -39,8 +39,7 @@ discard block |
||
39 | 39 | public function get($key, $namespace) { |
40 | 40 | |
41 | 41 | return $this->checkMemory($key, $namespace) ? |
42 | - $this->data[$namespace][$key]['data'] : |
|
43 | - null; |
|
42 | + $this->data[$namespace][$key]['data'] : null; |
|
44 | 43 | |
45 | 44 | } |
46 | 45 | |
@@ -94,7 +93,7 @@ discard block |
||
94 | 93 | |
95 | 94 | $result = []; |
96 | 95 | |
97 | - foreach ($keys as $key) { |
|
96 | + foreach ( $keys as $key ) { |
|
98 | 97 | $result[$key] = $this->get($key, $namespace); |
99 | 98 | } |
100 | 99 | |
@@ -106,7 +105,7 @@ discard block |
||
106 | 105 | |
107 | 106 | $result = []; |
108 | 107 | |
109 | - foreach ($key_values as $key => $value) { |
|
108 | + foreach ( $key_values as $key => $value ) { |
|
110 | 109 | $result[$key] = $this->set($key, $namespace, $value, $ttl); |
111 | 110 | } |
112 | 111 | |
@@ -118,7 +117,7 @@ discard block |
||
118 | 117 | |
119 | 118 | $result = []; |
120 | 119 | |
121 | - foreach ($keys as $key) { |
|
120 | + foreach ( $keys as $key ) { |
|
122 | 121 | $result[] = $this->delete($key, $namespace); |
123 | 122 | } |
124 | 123 |
@@ -156,12 +156,10 @@ |
||
156 | 156 | $time = new DateTime('now'); |
157 | 157 | |
158 | 158 | if ( !array_key_exists($namespace, $this->data) |
159 | - || !array_key_exists($key, $this->data[$namespace]) ) |
|
160 | - { |
|
159 | + || !array_key_exists($key, $this->data[$namespace]) ) { |
|
161 | 160 | return false; |
162 | 161 | } else if ( $this->data[$namespace][$key]['expire'] === 0 |
163 | - || $this->data[$namespace][$key]['expire'] > $time ) |
|
164 | - { |
|
162 | + || $this->data[$namespace][$key]['expire'] > $time ) { |
|
165 | 163 | return true; |
166 | 164 | } else { |
167 | 165 | unset($this->data[$namespace][$key]); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return "$scope-$key"; |
122 | 122 | }, $keys); |
123 | 123 | |
124 | - if (version_compare(phpversion(), '7.0.0', '<')) { |
|
124 | + if ( version_compare(phpversion(), '7.0.0', '<') ) { |
|
125 | 125 | $data = $this->getInstance()->getMulti($keyscope, $null = null, MemcachedInstance::GET_PRESERVE_ORDER); |
126 | 126 | } else { |
127 | 127 | $data = $this->getInstance()->getMulti($keyscope, MemcachedInstance::GET_PRESERVE_ORDER); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | $return = []; |
131 | 131 | |
132 | - foreach ($data as $scoped_key => $value) { |
|
132 | + foreach ( $data as $scoped_key => $value ) { |
|
133 | 133 | $key = substr($scoped_key, strlen("$scope-")); |
134 | 134 | $return[$key] = $value; |
135 | 135 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $shadowNames = []; |
152 | 152 | |
153 | - foreach ($key_values as $key => $value) { |
|
153 | + foreach ( $key_values as $key => $value ) { |
|
154 | 154 | $shadowNames["$scope-$key"] = $value; |
155 | 155 | } |
156 | 156 |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $result = []; |
177 | 177 | |
178 | - foreach ($keys as $key) { |
|
178 | + foreach ( $keys as $key ) { |
|
179 | 179 | $result[$key] = $this->get($key, $namespace); |
180 | 180 | } |
181 | 181 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $result = []; |
190 | 190 | |
191 | - foreach ($key_values as $key => $value) { |
|
191 | + foreach ( $key_values as $key => $value ) { |
|
192 | 192 | $result[] = $this->set($key, $namespace, $value, $ttl); |
193 | 193 | } |
194 | 194 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | |
202 | 202 | $result = []; |
203 | 203 | |
204 | - foreach ($keys as $key) { |
|
204 | + foreach ( $keys as $key ) { |
|
205 | 205 | $result[] = $this->delete($key, $namespace); |
206 | 206 | } |
207 | 207 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $objects = $instance->dbSize(); |
241 | 241 | $stats = $instance->info(); |
242 | 242 | |
243 | - } catch (RedisException $re ) { |
|
243 | + } catch (RedisException $re) { |
|
244 | 244 | |
245 | 245 | throw $re; |
246 | 246 |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | /** |
90 | 90 | * {@inheritdoc} |
91 | 91 | */ |
92 | - public function expiresAt($expiration=null) { |
|
92 | + public function expiresAt($expiration = null) { |
|
93 | 93 | |
94 | - if (is_null($expiration)) { |
|
94 | + if ( is_null($expiration) ) { |
|
95 | 95 | $this->expiration = 0; |
96 | 96 | } |
97 | 97 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } |
114 | 114 | |
115 | 115 | if ( is_numeric($time) ) { |
116 | - $this->expiration = new DateTime('now +' . $time . ' seconds'); |
|
116 | + $this->expiration = new DateTime('now +'.$time.' seconds'); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | if ( $time instanceof DateInterval ) { |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function getTtl() { |
155 | 155 | |
156 | - if (is_null($this->expiration)) return null; |
|
156 | + if ( is_null($this->expiration) ) return null; |
|
157 | 157 | |
158 | - if ($this->expiration === 0) return 0; |
|
158 | + if ( $this->expiration === 0 ) return 0; |
|
159 | 159 | |
160 | 160 | $now = new DateTime("now"); |
161 | 161 |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | |
95 | 95 | public function deleteItem($key) { |
96 | 96 | |
97 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
97 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
98 | 98 | return $this->selectProvider()->deleteItem($key); |
99 | 99 | } |
100 | 100 | |
101 | 101 | $result = []; |
102 | 102 | |
103 | - foreach ($this->stack as $provider) { |
|
103 | + foreach ( $this->stack as $provider ) { |
|
104 | 104 | |
105 | 105 | $result[] = $provider[0]->deleteItem($key); |
106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | |
113 | 113 | public function save(CacheItemInterface $item) { |
114 | 114 | |
115 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
115 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
116 | 116 | return $this->selectProvider()->save($item); |
117 | 117 | } |
118 | 118 | |
119 | 119 | $result = []; |
120 | 120 | |
121 | - foreach ($this->stack as $provider) { |
|
121 | + foreach ( $this->stack as $provider ) { |
|
122 | 122 | |
123 | 123 | $pro = $provider[0]; |
124 | 124 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | |
172 | 172 | if ( $mode == 'GET' ) { |
173 | 173 | |
174 | - foreach ($this->stack as $provider) { |
|
174 | + foreach ( $this->stack as $provider ) { |
|
175 | 175 | |
176 | 176 | $result[] = $provider[0]->getItem($key); |
177 | 177 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | } else { |
188 | 188 | |
189 | - foreach ($this->stack as $provider) { |
|
189 | + foreach ( $this->stack as $provider ) { |
|
190 | 190 | |
191 | 191 | $result[] = $provider[0]->hasItem($key); |
192 | 192 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | if ( $mode == 'GET' ) { |
209 | 209 | |
210 | - foreach ($this->stack as $provider) { |
|
210 | + foreach ( $this->stack as $provider ) { |
|
211 | 211 | |
212 | 212 | $item = $provider[0]->getItem($key); |
213 | 213 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | } else { |
231 | 231 | |
232 | - foreach ($this->stack as $provider) { |
|
232 | + foreach ( $this->stack as $provider ) { |
|
233 | 233 | |
234 | 234 | $item = $provider[0]->hasItem($key); |
235 | 235 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | throw new InvalidSimpleCacheArgumentException("Invalid or unspecified cache folder"); |
37 | 37 | } |
38 | 38 | |
39 | - if ( $cache_folder[strlen($cache_folder)-1] != "/" ) $cache_folder = "$cache_folder/"; |
|
39 | + if ( $cache_folder[strlen($cache_folder) - 1] != "/" ) $cache_folder = "$cache_folder/"; |
|
40 | 40 | |
41 | 41 | if ( self::isXattrSupported($cache_folder) ) { |
42 | 42 | $this->driver = new FilesystemXattrDriver(['cache-folder'=>$cache_folder]); |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | |
31 | 31 | public function __construct( |
32 | 32 | $server = '127.0.0.1', |
33 | - $port=11211, |
|
34 | - $weight=0, |
|
35 | - $persistent_id=null, |
|
36 | - LoggerInterface $logger=null |
|
33 | + $port = 11211, |
|
34 | + $weight = 0, |
|
35 | + $persistent_id = null, |
|
36 | + LoggerInterface $logger = null |
|
37 | 37 | ) { |
38 | 38 | |
39 | 39 | if ( empty($server) ) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $objects = 0; |
78 | 78 | |
79 | - foreach ($info as $key => $value) { |
|
79 | + foreach ( $info as $key => $value ) { |
|
80 | 80 | |
81 | 81 | $objects = max($objects, $value['curr_items']); |
82 | 82 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | */ |
59 | 59 | public function setLogger(LoggerInterface $logger = null) { |
60 | 60 | |
61 | - $this->logger = is_null($logger) ? LogManager::create('cache',false)->getLogger() : $logger; |
|
61 | + $this->logger = is_null($logger) ? LogManager::create('cache', false)->getLogger() : $logger; |
|
62 | 62 | |
63 | 63 | return $this; |
64 | 64 |