@@ -86,15 +86,15 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function set($key, $value, $ttl = null) { |
| 88 | 88 | |
| 89 | - if (iterator_count($this->stack) == 0) return $this->vacuum->set($key, $value, $ttl); |
|
| 89 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->set($key, $value, $ttl); |
|
| 90 | 90 | |
| 91 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 91 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 92 | 92 | return $this->selectProvider()->set($key, $value, $ttl); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $result = []; |
| 96 | 96 | |
| 97 | - foreach ($this->stack as $provider) { |
|
| 97 | + foreach ( $this->stack as $provider ) { |
|
| 98 | 98 | |
| 99 | 99 | $pro = $provider[0]; |
| 100 | 100 | |
@@ -113,15 +113,15 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | public function delete($key) { |
| 115 | 115 | |
| 116 | - if (iterator_count($this->stack) == 0) return $this->vacuum->delete($key); |
|
| 116 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->delete($key); |
|
| 117 | 117 | |
| 118 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 118 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 119 | 119 | return $this->selectProvider()->delete($key); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $result = []; |
| 123 | 123 | |
| 124 | - foreach ($this->stack as $provider) { |
|
| 124 | + foreach ( $this->stack as $provider ) { |
|
| 125 | 125 | |
| 126 | 126 | $result[] = $provider[0]->delete($key); |
| 127 | 127 | |
@@ -139,15 +139,15 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | public function setMultiple($values, $ttl = null) { |
| 141 | 141 | |
| 142 | - if (iterator_count($this->stack) == 0) return $this->vacuum->setMultiple($values, $ttl); |
|
| 142 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->setMultiple($values, $ttl); |
|
| 143 | 143 | |
| 144 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 144 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 145 | 145 | return $this->selectProvider()->setMultiple($values, $ttl); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $result = []; |
| 149 | 149 | |
| 150 | - foreach ($this->stack as $provider) { |
|
| 150 | + foreach ( $this->stack as $provider ) { |
|
| 151 | 151 | |
| 152 | 152 | $result[] = $provider[0]->setMultiple($values, $ttl); |
| 153 | 153 | |
@@ -159,15 +159,15 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | public function deleteMultiple($keys) { |
| 161 | 161 | |
| 162 | - if (iterator_count($this->stack) == 0) return $this->vacuum->deleteMultiple($keys); |
|
| 162 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->deleteMultiple($keys); |
|
| 163 | 163 | |
| 164 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 164 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 165 | 165 | return $this->selectProvider()->deleteMultiple($keys); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $result = []; |
| 169 | 169 | |
| 170 | - foreach ($this->stack as $provider) { |
|
| 170 | + foreach ( $this->stack as $provider ) { |
|
| 171 | 171 | |
| 172 | 172 | $result[] = $provider[0]->deleteMultiple($keys); |
| 173 | 173 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $manager = new Manager(...$manager_configuration); |
| 191 | 191 | |
| 192 | 192 | if ( $enable ) { |
| 193 | - foreach ($providers as $name => $provider) { |
|
| 193 | + foreach ( $providers as $name => $provider ) { |
|
| 194 | 194 | $instance = $provider->instance; |
| 195 | 195 | $weight = $provider->weight; |
| 196 | 196 | $id = $instance->getId(); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - protected function selectFrom($mode, $key, $default=null) { |
|
| 206 | + protected function selectFrom($mode, $key, $default = null) { |
|
| 207 | 207 | |
| 208 | 208 | if ( $this->pick_mode < 5 ) { |
| 209 | 209 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | $provider = $this->selectProvider(); |
| 229 | 229 | |
| 230 | - switch ($mode) { |
|
| 230 | + switch ( $mode ) { |
|
| 231 | 231 | |
| 232 | 232 | case 'GET': |
| 233 | 233 | $data = $provider->get($key, $default); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | if ( $mode == 'GET' ) { |
| 255 | 255 | |
| 256 | - foreach ($this->stack as $provider) { |
|
| 256 | + foreach ( $this->stack as $provider ) { |
|
| 257 | 257 | |
| 258 | 258 | $result[] = $provider[0]->get($key, $default); |
| 259 | 259 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | } else if ( $mode == 'GETMULTIPLE' ) { |
| 270 | 270 | |
| 271 | - foreach ($this->stack as $provider) { |
|
| 271 | + foreach ( $this->stack as $provider ) { |
|
| 272 | 272 | |
| 273 | 273 | $result[] = $provider[0]->getMultiple($key, $default); |
| 274 | 274 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | } else { |
| 289 | 289 | |
| 290 | - foreach ($this->stack as $provider) { |
|
| 290 | + foreach ( $this->stack as $provider ) { |
|
| 291 | 291 | |
| 292 | 292 | $result[] = $provider[0]->has($key); |
| 293 | 293 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | if ( $mode == 'GET' ) { |
| 310 | 310 | |
| 311 | - foreach ($this->stack as $provider) { |
|
| 311 | + foreach ( $this->stack as $provider ) { |
|
| 312 | 312 | |
| 313 | 313 | $item = $provider[0]->get($key); |
| 314 | 314 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | } else if ( $mode == 'GETMULTIPLE' ) { |
| 332 | 332 | |
| 333 | - foreach ($this->stack as $provider) { |
|
| 333 | + foreach ( $this->stack as $provider ) { |
|
| 334 | 334 | |
| 335 | 335 | $items = $provider[0]->getMultiple($key); |
| 336 | 336 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | |
| 355 | 355 | } else { |
| 356 | 356 | |
| 357 | - foreach ($this->stack as $provider) { |
|
| 357 | + foreach ( $this->stack as $provider ) { |
|
| 358 | 358 | |
| 359 | 359 | $item = $provider[0]->has($key); |
| 360 | 360 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public static function parse(Configuration $configuration, LoggerInterface $logger) { |
| 44 | 44 | |
| 45 | - list($enable, $manager) = self::parseManagerConfiguration($configuration, $logger); |
|
| 45 | + list($enable, $manager) = self::parseManagerConfiguration($configuration, $logger); |
|
| 46 | 46 | $providers = self::buildProviders($configuration, $logger); |
| 47 | 47 | |
| 48 | 48 | return [ |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if ( isset($lower_cache['enable']) && $lower_cache['enable'] === false ) $enable = false; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if ($stdConfig['pick_mode'] !== null) $stdConfig['pick_mode'] = self::getPickMode($stdConfig['pick_mode']); |
|
| 118 | + if ( $stdConfig['pick_mode'] !== null ) $stdConfig['pick_mode'] = self::getPickMode($stdConfig['pick_mode']); |
|
| 119 | 119 | |
| 120 | 120 | return [$enable, array_values($stdConfig)]; |
| 121 | 121 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $providers = $lower_cache['providers']; |
| 136 | 136 | |
| 137 | - foreach ($providers as $name => $specs) { |
|
| 137 | + foreach ( $providers as $name => $specs ) { |
|
| 138 | 138 | |
| 139 | 139 | if ( !is_array($specs) ) { |
| 140 | 140 | $logger->error("Invalid specs for cache provider: $name"); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | |
| 151 | 151 | $type = strtoupper($spec['type']); |
| 152 | 152 | |
| 153 | - switch ($type) { |
|
| 153 | + switch ( $type ) { |
|
| 154 | 154 | |
| 155 | 155 | case 'APC': |
| 156 | 156 | $provider = static::BuildApcProvider($logger); |
@@ -96,15 +96,15 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function deleteItem($key) { |
| 98 | 98 | |
| 99 | - if (iterator_count($this->stack) == 0) return $this->vacuum->deleteItem($key); |
|
| 99 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->deleteItem($key); |
|
| 100 | 100 | |
| 101 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 101 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 102 | 102 | return $this->selectProvider()->deleteItem($key); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $result = []; |
| 106 | 106 | |
| 107 | - foreach ($this->stack as $provider) { |
|
| 107 | + foreach ( $this->stack as $provider ) { |
|
| 108 | 108 | |
| 109 | 109 | $result[] = $provider[0]->deleteItem($key); |
| 110 | 110 | |
@@ -116,15 +116,15 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | public function save(CacheItemInterface $item) { |
| 118 | 118 | |
| 119 | - if (iterator_count($this->stack) == 0) return $this->vacuum->save($item); |
|
| 119 | + if ( iterator_count($this->stack) == 0 ) return $this->vacuum->save($item); |
|
| 120 | 120 | |
| 121 | - if ( $this->align_cache === false && $this->pick_mode < 5) { |
|
| 121 | + if ( $this->align_cache === false && $this->pick_mode < 5 ) { |
|
| 122 | 122 | return $this->selectProvider()->save($item); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | $result = []; |
| 126 | 126 | |
| 127 | - foreach ($this->stack as $provider) { |
|
| 127 | + foreach ( $this->stack as $provider ) { |
|
| 128 | 128 | |
| 129 | 129 | $pro = $provider[0]; |
| 130 | 130 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $manager = new Manager(...$manager_configuration); |
| 149 | 149 | |
| 150 | 150 | if ( $enable ) { |
| 151 | - foreach ($providers as $name => $provider) { |
|
| 151 | + foreach ( $providers as $name => $provider ) { |
|
| 152 | 152 | $instance = $provider->instance; |
| 153 | 153 | $weight = $provider->weight; |
| 154 | 154 | $id = $instance->getId(); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | |
| 198 | 198 | if ( $mode == 'GET' ) { |
| 199 | 199 | |
| 200 | - foreach ($this->stack as $provider) { |
|
| 200 | + foreach ( $this->stack as $provider ) { |
|
| 201 | 201 | |
| 202 | 202 | $result[] = $provider[0]->getItem($key); |
| 203 | 203 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | } else { |
| 214 | 214 | |
| 215 | - foreach ($this->stack as $provider) { |
|
| 215 | + foreach ( $this->stack as $provider ) { |
|
| 216 | 216 | |
| 217 | 217 | $result[] = $provider[0]->hasItem($key); |
| 218 | 218 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | |
| 234 | 234 | if ( $mode == 'GET' ) { |
| 235 | 235 | |
| 236 | - foreach ($this->stack as $provider) { |
|
| 236 | + foreach ( $this->stack as $provider ) { |
|
| 237 | 237 | |
| 238 | 238 | $item = $provider[0]->getItem($key); |
| 239 | 239 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | } else { |
| 257 | 257 | |
| 258 | - foreach ($this->stack as $provider) { |
|
| 258 | + foreach ( $this->stack as $provider ) { |
|
| 259 | 259 | |
| 260 | 260 | $item = $provider[0]->hasItem($key); |
| 261 | 261 | |