@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | ->getTimestamp()) * 1000) : new UTCDateTime(\time() * 1000)), |
| 125 | 125 | ]; |
| 126 | 126 | } |
| 127 | - $result = (array)$this->getCollection()->updateOne( |
|
| 127 | + $result = (array) $this->getCollection()->updateOne( |
|
| 128 | 128 | ['_id' => $item->getEncodedKey()], |
| 129 | 129 | [ |
| 130 | 130 | '$set' => $set, |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | 'verbose' => true, |
| 272 | 272 | ]))->toArray()[0]; |
| 273 | 273 | |
| 274 | - $array_filter_recursive = function ($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 274 | + $array_filter_recursive = function($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 275 | 275 | $array = $callback($array); |
| 276 | 276 | |
| 277 | 277 | if (\is_object($array) || \is_array($array)) { |
@@ -283,12 +283,12 @@ discard block |
||
| 283 | 283 | return $array; |
| 284 | 284 | }; |
| 285 | 285 | |
| 286 | - $callback = function ($item) { |
|
| 286 | + $callback = function($item) { |
|
| 287 | 287 | /** |
| 288 | 288 | * Remove unserializable properties |
| 289 | 289 | */ |
| 290 | 290 | if ($item instanceof \MongoDB\BSON\UTCDateTime) { |
| 291 | - return (string)$item; |
|
| 291 | + return (string) $item; |
|
| 292 | 292 | } |
| 293 | 293 | return $item; |
| 294 | 294 | }; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if ($item instanceof Item) { |
| 90 | 90 | $ttl = $item->getExpirationDate()->getTimestamp() - \time(); |
| 91 | 91 | |
| 92 | - return (bool)apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 92 | + return (bool) apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * Check for Cross-Driver type confusion |
| 107 | 107 | */ |
| 108 | 108 | if ($item instanceof Item) { |
| 109 | - return (bool)apc_delete($item->getKey()); |
|
| 109 | + return (bool) apc_delete($item->getKey()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function getStats(): DriverStatistic |
| 133 | 133 | { |
| 134 | - $stats = (array)apc_cache_info('user'); |
|
| 134 | + $stats = (array) apc_cache_info('user'); |
|
| 135 | 135 | $date = (new \DateTime())->setTimestamp($stats['start_time']); |
| 136 | 136 | |
| 137 | 137 | return (new DriverStatistic()) |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | * Check for Cross-Driver type confusion |
| 95 | 95 | */ |
| 96 | 96 | if ($item instanceof Item) { |
| 97 | - return (bool)zend_disk_cache_delete($item->getKey()); |
|
| 97 | + return (bool) zend_disk_cache_delete($item->getKey()); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if ($item instanceof Item) { |
| 64 | 64 | $ttl = $item->getExpirationDate()->getTimestamp() - \time(); |
| 65 | 65 | |
| 66 | - return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 66 | + return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * Check for Cross-Driver type confusion |
| 95 | 95 | */ |
| 96 | 96 | if ($item instanceof Item) { |
| 97 | - return (bool)apcu_delete($item->getKey()); |
|
| 97 | + return (bool) apcu_delete($item->getKey()); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function getStats(): DriverStatistic |
| 121 | 121 | { |
| 122 | - $stats = (array)apcu_cache_info(); |
|
| 122 | + $stats = (array) apcu_cache_info(); |
|
| 123 | 123 | $date = (new \DateTime())->setTimestamp($stats['start_time']); |
| 124 | 124 | |
| 125 | 125 | return (new DriverStatistic()) |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * Check for Cross-Driver type confusion |
| 95 | 95 | */ |
| 96 | 96 | if ($item instanceof Item) { |
| 97 | - return (bool)zend_shm_cache_delete($item->getKey()); |
|
| 97 | + return (bool) zend_shm_cache_delete($item->getKey()); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function getStats(): DriverStatistic |
| 133 | 133 | { |
| 134 | - $stats = (array)zend_shm_cache_info(); |
|
| 134 | + $stats = (array) zend_shm_cache_info(); |
|
| 135 | 135 | return (new DriverStatistic()) |
| 136 | 136 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 137 | 137 | ->setInfo(\sprintf("The Zend memory have %d item(s) in cache.\n For more information see RawData.", $stats['items_total'])) |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | public function __construct(...$args) |
| 98 | 98 | { |
| 99 | 99 | parent::__construct(...$args); |
| 100 | - $array =& $this->getArray(); |
|
| 100 | + $array = & $this->getArray(); |
|
| 101 | 101 | |
| 102 | 102 | /** |
| 103 | 103 | * Detect unwanted keys and throw an exception. |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if (!isset($this->tmp[$full_path_hash]) || (!@\file_exists($full_path) || !@\is_writable($full_path))) { |
| 106 | 106 | if (!@\file_exists($full_path)) { |
| 107 | - if (@mkdir($full_path, $this->getDefaultChmod(), true) === false && !\is_dir($full_path) ) { |
|
| 108 | - throw new PhpfastcacheIOException('The directory '.$full_path.' could not be created.'); |
|
| 107 | + if (@mkdir($full_path, $this->getDefaultChmod(), true) === false && !\is_dir($full_path)) { |
|
| 108 | + throw new PhpfastcacheIOException('The directory ' . $full_path . ' could not be created.'); |
|
| 109 | 109 | } |
| 110 | 110 | } else { |
| 111 | 111 | if (!@\is_writable($full_path)) { |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | $full_path = $full_path_tmp; |
| 118 | 118 | if (!@\file_exists($full_path)) { |
| 119 | - if(@mkdir($full_path, $this->getDefaultChmod(), true) && !\is_dir($full_path)){ |
|
| 120 | - throw new PhpfastcacheIOException('The directory '.$full_path.' could not be created.'); |
|
| 119 | + if (@mkdir($full_path, $this->getDefaultChmod(), true) && !\is_dir($full_path)) { |
|
| 120 | + throw new PhpfastcacheIOException('The directory ' . $full_path . ' could not be created.'); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | )); |
| 300 | 300 | |
| 301 | 301 | $f = \fopen($tmpFilename, 'w+b'); |
| 302 | - if(\is_resource($f)){ |
|
| 302 | + if (\is_resource($f)) { |
|
| 303 | 303 | \flock($f, \LOCK_EX); |
| 304 | 304 | $octetWritten = fwrite($f, $data); |
| 305 | 305 | \flock($f, \LOCK_UN); |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | } else { |
| 313 | 313 | $f = \fopen($file, 'w+b'); |
| 314 | - if(\is_resource($f)){ |
|
| 314 | + if (\is_resource($f)) { |
|
| 315 | 315 | $octetWritten = \fwrite($f, $data); |
| 316 | 316 | \fclose($f); |
| 317 | 317 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function getStats(): DriverStatistic |
| 198 | 198 | { |
| 199 | - $stats = (array)$this->instance->getstats(); |
|
| 199 | + $stats = (array) $this->instance->getstats(); |
|
| 200 | 200 | $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0); |
| 201 | 201 | $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion'); |
| 202 | 202 | $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0); |
@@ -207,6 +207,6 @@ discard block |
||
| 207 | 207 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 208 | 208 | ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(\DATE_RFC2822))) |
| 209 | 209 | ->setRawData($stats) |
| 210 | - ->setSize((int)$stats['bytes']); |
|
| 210 | + ->setSize((int) $stats['bytes']); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | \ No newline at end of file |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * Check for Cross-Driver type confusion |
| 146 | 146 | */ |
| 147 | 147 | if ($item instanceof Item) { |
| 148 | - return (bool)$this->instance->del($item->getKey()); |
|
| 148 | + return (bool) $this->instance->del($item->getKey()); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return (new DriverStatistic()) |
| 178 | 178 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 179 | 179 | ->setRawData($info) |
| 180 | - ->setSize((int)$info['used_memory']) |
|
| 180 | + ->setSize((int) $info['used_memory']) |
|
| 181 | 181 | ->setInfo(\sprintf("The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
| 182 | 182 | $info['redis_version'], $date->format(\DATE_RFC2822))); |
| 183 | 183 | } |