@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - public function getAll($enabled=true) { |
|
| 130 | + public function getAll($enabled = true) { |
|
| 131 | 131 | |
| 132 | 132 | return $enabled ? $this->getEnabled() : $this->stack; |
| 133 | 133 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $return = array(); |
| 196 | 196 | |
| 197 | - foreach ($this->stack as $id => $cache) { |
|
| 197 | + foreach ( $this->stack as $id => $cache ) { |
|
| 198 | 198 | $this->checkCacheFlap($id, $cache); |
| 199 | 199 | if ( $cache->isEnabled() ) $return[$id] = $cache; |
| 200 | 200 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | /** |
| 42 | 42 | * {@inheritdoc} |
| 43 | 43 | */ |
| 44 | - public function setNamespace($namespace=null) { |
|
| 44 | + public function setNamespace($namespace = null) { |
|
| 45 | 45 | |
| 46 | 46 | if ( empty($namespace) ) { |
| 47 | 47 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * |
| 35 | 35 | * @throws \Comodojo\Exception\CacheException |
| 36 | 36 | */ |
| 37 | - public function __construct( $server, $port=11211, $weight=0, $persistent_id=null, LoggerInterface $logger=null ) { |
|
| 37 | + public function __construct($server, $port = 11211, $weight = 0, $persistent_id = null, LoggerInterface $logger = null) { |
|
| 38 | 38 | |
| 39 | 39 | parent::__construct($server, $port, $weight, $persistent_id, $logger); |
| 40 | 40 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * |
| 34 | 34 | * @throws \Comodojo\Exception\CacheException |
| 35 | 35 | */ |
| 36 | - public function __construct( $server, $port=6379, $timeout=0, LoggerInterface $logger=null ) { |
|
| 36 | + public function __construct($server, $port = 6379, $timeout = 0, LoggerInterface $logger = null) { |
|
| 37 | 37 | |
| 38 | 38 | parent::__construct($server, $port, $timeout, $logger); |
| 39 | 39 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @throws \Comodojo\Exception\CacheException |
| 42 | 42 | */ |
| 43 | - public function __construct( $server, $port=11211, $weight=0, $persistent_id=null, LoggerInterface $logger=null ) { |
|
| 43 | + public function __construct($server, $port = 11211, $weight = 0, $persistent_id = null, LoggerInterface $logger = null) { |
|
| 44 | 44 | |
| 45 | 45 | if ( empty($server) ) throw new CacheException("Invalid or unspecified memcached server"); |
| 46 | 46 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * {@inheritdoc} |
| 69 | 69 | */ |
| 70 | - public function set($name, $data, $ttl=null) { |
|
| 70 | + public function set($name, $data, $ttl = null) { |
|
| 71 | 71 | |
| 72 | 72 | if ( empty($name) ) throw new CacheException("Name of object cannot be empty"); |
| 73 | 73 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | /** |
| 173 | 173 | * {@inheritdoc} |
| 174 | 174 | */ |
| 175 | - public function delete($name=null) { |
|
| 175 | + public function delete($name = null) { |
|
| 176 | 176 | |
| 177 | 177 | if ( !$this->isEnabled() ) return false; |
| 178 | 178 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | $objects = 0; |
| 254 | 254 | |
| 255 | - foreach ($stats as $key => $value) { |
|
| 255 | + foreach ( $stats as $key => $value ) { |
|
| 256 | 256 | |
| 257 | 257 | $objects = max($objects, $value['curr_items']); |
| 258 | 258 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | class XCache extends AbstractProvider { |
| 27 | 27 | |
| 28 | - /** |
|
| 28 | + /** |
|
| 29 | 29 | * Class constructor |
| 30 | 30 | * |
| 31 | 31 | * @param LoggerInterface $logger |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @throws \Comodojo\Exception\CacheException |
| 34 | 34 | */ |
| 35 | - public function __construct(LoggerInterface $logger=null ) { |
|
| 35 | + public function __construct(LoggerInterface $logger = null) { |
|
| 36 | 36 | |
| 37 | 37 | parent::__construct($logger); |
| 38 | 38 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * {@inheritdoc} |
| 53 | 53 | */ |
| 54 | - public function set($name, $data, $ttl=null) { |
|
| 54 | + public function set($name, $data, $ttl = null) { |
|
| 55 | 55 | |
| 56 | 56 | if ( empty($name) ) throw new CacheException("Name of object cannot be empty"); |
| 57 | 57 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | /** |
| 122 | 122 | * {@inheritdoc} |
| 123 | 123 | */ |
| 124 | - public function delete($name=null) { |
|
| 124 | + public function delete($name = null) { |
|
| 125 | 125 | |
| 126 | 126 | if ( !$this->isEnabled() ) return false; |
| 127 | 127 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | private static function getXCacheStatus() { |
| 186 | 186 | |
| 187 | - return ( extension_loaded('xcache') && function_exists("xcache_get") ); |
|
| 187 | + return (extension_loaded('xcache') && function_exists("xcache_get")); |
|
| 188 | 188 | |
| 189 | 189 | } |
| 190 | 190 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * |
| 41 | 41 | * @throws \Comodojo\Exception\CacheException |
| 42 | 42 | */ |
| 43 | - public function __construct( $server, $port=6379, $timeout=0, LoggerInterface $logger=null ) { |
|
| 43 | + public function __construct($server, $port = 6379, $timeout = 0, LoggerInterface $logger = null) { |
|
| 44 | 44 | |
| 45 | 45 | if ( empty($server) ) throw new CacheException("Invalid or unspecified memcached server"); |
| 46 | 46 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | if ( $this->instance->connect($server, $port, $weight) === false ) { |
| 77 | 77 | |
| 78 | - $this->logger->error("Error communicating with Redis server, disabling PhpRedisProvider administratively", array( $this->instance->getLastError() ) ); |
|
| 78 | + $this->logger->error("Error communicating with Redis server, disabling PhpRedisProvider administratively", array($this->instance->getLastError())); |
|
| 79 | 79 | |
| 80 | 80 | $this->disable(); |
| 81 | 81 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | /** |
| 87 | 87 | * {@inheritdoc} |
| 88 | 88 | */ |
| 89 | - public function set($name, $data, $ttl=null) { |
|
| 89 | + public function set($name, $data, $ttl = null) { |
|
| 90 | 90 | |
| 91 | 91 | if ( empty($name) ) throw new CacheException("Name of object cannot be empty"); |
| 92 | 92 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | if ( $namespace === false ) { |
| 108 | 108 | |
| 109 | - $this->logger->error("Error writing cache (PhpRedis), exiting gracefully", array( $this->instance->getLastError())); |
|
| 109 | + $this->logger->error("Error writing cache (PhpRedis), exiting gracefully", array($this->instance->getLastError())); |
|
| 110 | 110 | |
| 111 | 111 | $this->setErrorState("Error writing cache (PhpRedis)"); |
| 112 | 112 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if ( $return === false ) { |
| 126 | 126 | |
| 127 | - $this->logger->error("Error writing cache (PhpRedis), exiting gracefully", array( $this->instance->getLastError())); |
|
| 127 | + $this->logger->error("Error writing cache (PhpRedis), exiting gracefully", array($this->instance->getLastError())); |
|
| 128 | 128 | |
| 129 | 129 | $this->setErrorState("Error writing cache (PhpRedis)"); |
| 130 | 130 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - } catch (RedisException $re ) { |
|
| 135 | + } catch (RedisException $re) { |
|
| 136 | 136 | |
| 137 | 137 | $this->logger->error("Server unreachable (PhpRedis), exiting gracefully", array( |
| 138 | 138 | "RESULTCODE" => $re->getCode(), |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - } catch (RedisException $re ) { |
|
| 191 | + } catch (RedisException $re) { |
|
| 192 | 192 | |
| 193 | 193 | $this->logger->error("Server unreachable (PhpRedis), exiting gracefully", array( |
| 194 | 194 | "RESULTCODE" => $re->getCode(), |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | /** |
| 213 | 213 | * {@inheritdoc} |
| 214 | 214 | */ |
| 215 | - public function delete($name=null) { |
|
| 215 | + public function delete($name = null) { |
|
| 216 | 216 | |
| 217 | 217 | if ( !$this->isEnabled() ) return false; |
| 218 | 218 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - } catch (RedisException $re ) { |
|
| 237 | + } catch (RedisException $re) { |
|
| 238 | 238 | |
| 239 | 239 | $this->logger->error("Server unreachable (PhpRedis), exiting gracefully", array( |
| 240 | 240 | "RESULTCODE" => $re->getCode(), |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | $this->instance->flushDB(); |
| 270 | 270 | |
| 271 | - } catch (RedisException $re ) { |
|
| 271 | + } catch (RedisException $re) { |
|
| 272 | 272 | |
| 273 | 273 | $this->logger->error("Server unreachable (PhpRedis), exiting gracefully", array( |
| 274 | 274 | "RESULTCODE" => $re->getCode(), |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $options = $this->instance->info(); |
| 313 | 313 | |
| 314 | - } catch (RedisException $re ) { |
|
| 314 | + } catch (RedisException $re) { |
|
| 315 | 315 | |
| 316 | 316 | $this->logger->error("Server unreachable (PhpRedis), exiting gracefully", array( |
| 317 | 317 | "RESULTCODE" => $re->getCode(), |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | $return = $this->instance->set($this->getNamespace(), $uId); |
| 348 | 348 | |
| 349 | - } catch (RedisException $re ) { |
|
| 349 | + } catch (RedisException $re) { |
|
| 350 | 350 | |
| 351 | 351 | throw $re; |
| 352 | 352 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | $return = $this->instance->get($this->getNamespace()); |
| 369 | 369 | |
| 370 | - } catch (RedisException $re ) { |
|
| 370 | + } catch (RedisException $re) { |
|
| 371 | 371 | |
| 372 | 372 | throw $re; |
| 373 | 373 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // In cli, apcu SHOULD NOT use the request time for cache retrieve/invalidation. |
| 48 | 48 | // This is because in cli the request time is allways the same. |
| 49 | 49 | if ( php_sapi_name() === 'cli' ) { |
| 50 | - ini_set('apc.use_request_time',0); |
|
| 50 | + ini_set('apc.use_request_time', 0); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | |
| 293 | 293 | if ( $apcu ) self::$is_apcu = true; |
| 294 | 294 | |
| 295 | - return ( ( $apc || $apcu ) && ini_get('apc.enabled') ); |
|
| 295 | + return (($apc || $apcu) && ini_get('apc.enabled')); |
|
| 296 | 296 | |
| 297 | 297 | } |
| 298 | 298 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | * |
| 31 | 31 | * @throws \Comodojo\Exception\CacheException |
| 32 | 32 | */ |
| 33 | - public function __construct($select_mode = null, LoggerInterface $logger = null, $default_ttl = 3600, $flap_interval = 600) { |
|
| 33 | + public function __construct($select_mode = null, LoggerInterface $logger = null, $default_ttl = 3600, $flap_interval = 600) { |
|
| 34 | 34 | |
| 35 | 35 | parent::__construct($select_mode, $logger); |
| 36 | 36 | |