@@ -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 | |
@@ -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 | |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function getMultiple($keys, $default = null) { |
| 146 | 146 | |
| 147 | - if ( !is_array($keys) && !($keys instanceof Traversable ) ) { |
|
| 147 | + if ( !is_array($keys) && !($keys instanceof Traversable) ) { |
|
| 148 | 148 | throw new InvalidSimpleCacheArgumentException('Invalid keys provided'); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - foreach ($keys as $key) { |
|
| 151 | + foreach ( $keys as $key ) { |
|
| 152 | 152 | if ( KeyValidator::validateKey($key) === false ) { |
| 153 | 153 | throw new InvalidSimpleCacheArgumentException('Invalid key provided'); |
| 154 | 154 | } |
@@ -174,13 +174,13 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | public function setMultiple($values, $ttl = null) { |
| 176 | 176 | |
| 177 | - if ( !is_array($values) && !($values instanceof Traversable ) ) { |
|
| 177 | + if ( !is_array($values) && !($values instanceof Traversable) ) { |
|
| 178 | 178 | throw new InvalidSimpleCacheArgumentException('Invalid keys provided'); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | $real_values = []; |
| 182 | 182 | |
| 183 | - foreach ($values as $key => $value) { |
|
| 183 | + foreach ( $values as $key => $value ) { |
|
| 184 | 184 | if ( KeyValidator::validateKey($key) === false ) { |
| 185 | 185 | throw new InvalidSimpleCacheArgumentException('Invalid key provided'); |
| 186 | 186 | } |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | public function deleteMultiple($keys) { |
| 215 | 215 | |
| 216 | - if ( !is_array($keys) && !($keys instanceof Traversable ) ) { |
|
| 216 | + if ( !is_array($keys) && !($keys instanceof Traversable) ) { |
|
| 217 | 217 | throw new InvalidSimpleCacheArgumentException('Invalid keys provided'); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - foreach ($keys as $key) { |
|
| 220 | + foreach ( $keys as $key ) { |
|
| 221 | 221 | if ( KeyValidator::validateKey($key) === false ) { |
| 222 | 222 | throw new InvalidSimpleCacheArgumentException('Invalid key provided'); |
| 223 | 223 | } |
@@ -31,9 +31,9 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function __construct( |
| 33 | 33 | $server = '127.0.0.1', |
| 34 | - $port=6379, |
|
| 35 | - $timeout=0, |
|
| 36 | - LoggerInterface $logger=null |
|
| 34 | + $port = 6379, |
|
| 35 | + $timeout = 0, |
|
| 36 | + LoggerInterface $logger = null |
|
| 37 | 37 | ) { |
| 38 | 38 | |
| 39 | 39 | if ( empty($server) ) { |
@@ -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 | |