@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface, IO\IOHelperTrait}; |
19 | 19 | use Phpfastcache\Exceptions\{ |
20 | - PhpfastcacheInvalidArgumentException |
|
20 | + PhpfastcacheInvalidArgumentException |
|
21 | 21 | }; |
22 | 22 | use Phpfastcache\Util\Directory; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Files\Driver as FilesDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException |
|
22 | + PhpfastcacheInvalidArgumentException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | |
18 | 18 | use Phpfastcache\Config\ConfigurationOption; |
19 | 19 | use Phpfastcache\Core\Pool\{ |
20 | - DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
20 | + DriverBaseTrait, ExtendedCacheItemPoolInterface |
|
21 | 21 | }; |
22 | 22 | use Phpfastcache\Entities\DriverStatistic; |
23 | 23 | use Phpfastcache\Exceptions\{ |
24 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
24 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
25 | 25 | }; |
26 | 26 | use Phpfastcache\Util\ArrayObject; |
27 | 27 | use Psr\Cache\CacheItemInterface; |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]); |
163 | 163 | |
164 | 164 | return (new DriverStatistic()) |
165 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
166 | - ->setRawData($info) |
|
167 | - ->setSize((int)$info[ 'used_memory' ]) |
|
168 | - ->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.", |
|
165 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
166 | + ->setRawData($info) |
|
167 | + ->setSize((int)$info[ 'used_memory' ]) |
|
168 | + ->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.", |
|
169 | 169 | $info[ 'redis_version' ], $date->format(DATE_RFC2822))); |
170 | 170 | } |
171 | 171 | } |
172 | 172 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
12 | 12 | * |
13 | 13 | */ |
14 | -declare(strict_types=1); |
|
14 | +declare(strict_types = 1); |
|
15 | 15 | |
16 | 16 | namespace Phpfastcache\Drivers\Redis; |
17 | 17 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if ($this->config->getOption('path')) { |
64 | 64 | $isConnected = $this->instance->connect($this->config->getOption('path')); |
65 | 65 | } else { |
66 | - $isConnected = $this->instance->connect($this->config->getOption('host'), $this->config->getOption('port'), (int)$this->config->getOption('timeout')); |
|
66 | + $isConnected = $this->instance->connect($this->config->getOption('host'), $this->config->getOption('port'), (int) $this->config->getOption('timeout')); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | if (!$isConnected && $this->config->getOption('path')) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * Check for Cross-Driver type confusion |
133 | 133 | */ |
134 | 134 | if ($item instanceof Item) { |
135 | - return (bool)$this->instance->del($item->getKey()); |
|
135 | + return (bool) $this->instance->del($item->getKey()); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -159,13 +159,13 @@ discard block |
||
159 | 159 | { |
160 | 160 | // used_memory |
161 | 161 | $info = $this->instance->info(); |
162 | - $date = (new \DateTime())->setTimestamp(time() - $info[ 'uptime_in_seconds' ]); |
|
162 | + $date = (new \DateTime())->setTimestamp(time() - $info['uptime_in_seconds']); |
|
163 | 163 | |
164 | 164 | return (new DriverStatistic()) |
165 | 165 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
166 | 166 | ->setRawData($info) |
167 | - ->setSize((int)$info[ 'used_memory' ]) |
|
167 | + ->setSize((int) $info['used_memory']) |
|
168 | 168 | ->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.", |
169 | - $info[ 'redis_version' ], $date->format(DATE_RFC2822))); |
|
169 | + $info['redis_version'], $date->format(DATE_RFC2822))); |
|
170 | 170 | } |
171 | 171 | } |
172 | 172 | \ No newline at end of file |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Redis\Driver as RedisDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException |
|
21 | + PhpfastcacheInvalidArgumentException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 | |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
122 | 122 | |
123 | 123 | return (new DriverStatistic()) |
124 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
125 | - ->setInfo(\sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
124 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
125 | + ->setInfo(\sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
126 | 126 | $stats[ 'num_entries' ])) |
127 | - ->setRawData($stats) |
|
128 | - ->setSize($stats[ 'mem_size' ]); |
|
127 | + ->setRawData($stats) |
|
128 | + ->setSize($stats[ 'mem_size' ]); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @author Georges.L (Geolim4) <[email protected]> |
12 | 12 | * |
13 | 13 | */ |
14 | -declare(strict_types=1); |
|
14 | +declare(strict_types = 1); |
|
15 | 15 | |
16 | 16 | namespace Phpfastcache\Drivers\Apcu; |
17 | 17 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ($item instanceof Item) { |
62 | 62 | $ttl = $item->getExpirationDate()->getTimestamp() - time(); |
63 | 63 | |
64 | - return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
64 | + return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * Check for Cross-Driver type confusion |
93 | 93 | */ |
94 | 94 | if ($item instanceof Item) { |
95 | - return (bool)apcu_delete($item->getKey()); |
|
95 | + return (bool) apcu_delete($item->getKey()); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getStats(): DriverStatistic |
119 | 119 | { |
120 | - $stats = (array)apcu_cache_info(); |
|
121 | - $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
|
120 | + $stats = (array) apcu_cache_info(); |
|
121 | + $date = (new \DateTime())->setTimestamp($stats['start_time']); |
|
122 | 122 | |
123 | 123 | return (new DriverStatistic()) |
124 | 124 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
125 | 125 | ->setInfo(\sprintf("The APCU cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
126 | - $stats[ 'num_entries' ])) |
|
126 | + $stats['num_entries'])) |
|
127 | 127 | ->setRawData($stats) |
128 | - ->setSize($stats[ 'mem_size' ]); |
|
128 | + ->setSize($stats['mem_size']); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | \ No newline at end of file |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Apcu\Driver as ApcuDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
18 | 18 | use Phpfastcache\Entities\DriverStatistic; |
19 | 19 | use Phpfastcache\Exceptions\{ |
20 | - PhpfastcacheInvalidArgumentException |
|
20 | + PhpfastcacheInvalidArgumentException |
|
21 | 21 | }; |
22 | 22 | use Psr\Cache\CacheItemInterface; |
23 | 23 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | { |
132 | 132 | $stat = new DriverStatistic(); |
133 | 133 | $stat->setInfo('[ZendDisk] A void info string') |
134 | - ->setSize(0) |
|
135 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
136 | - ->setRawData(false); |
|
134 | + ->setSize(0) |
|
135 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
136 | + ->setRawData(false); |
|
137 | 137 | |
138 | 138 | return $stat; |
139 | 139 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
19 | 19 | use Phpfastcache\Drivers\Zenddisk\Driver as ZendDiskDriver; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | 22 | }; |
23 | 23 | |
24 | 24 | /** |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException |
|
21 | + PhpfastcacheInvalidArgumentException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 | |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | protected function driverRead(CacheItemInterface $item): array |
65 | 65 | { |
66 | 66 | return [ |
67 | - self::DRIVER_DATA_WRAPPER_INDEX => true, |
|
68 | - self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
69 | - self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(), |
|
67 | + self::DRIVER_DATA_WRAPPER_INDEX => true, |
|
68 | + self::DRIVER_TAGS_WRAPPER_INDEX => [], |
|
69 | + self::DRIVER_EDATE_WRAPPER_INDEX => new \DateTime(), |
|
70 | 70 | ]; |
71 | 71 | } |
72 | 72 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | { |
117 | 117 | $stat = new DriverStatistic(); |
118 | 118 | $stat->setInfo('[Devtrue] A void info string') |
119 | - ->setSize(0) |
|
120 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
121 | - ->setRawData(true); |
|
119 | + ->setSize(0) |
|
120 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
121 | + ->setRawData(true); |
|
122 | 122 | |
123 | 123 | return $stat; |
124 | 124 | } |