@@ -11,7 +11,7 @@ |
||
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\Devnull; |
17 | 17 |
@@ -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 | |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | { |
113 | 113 | $stat = new DriverStatistic(); |
114 | 114 | $stat->setInfo('[Devnull] A void info string') |
115 | - ->setSize(0) |
|
116 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
117 | - ->setRawData(null); |
|
115 | + ->setSize(0) |
|
116 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
117 | + ->setRawData(null); |
|
118 | 118 | |
119 | 119 | return $stat; |
120 | 120 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | * @author Lucas Brucksch <[email protected]> |
11 | 11 | * |
12 | 12 | */ |
13 | -declare(strict_types=1); |
|
13 | +declare(strict_types = 1); |
|
14 | 14 | |
15 | 15 | namespace Phpfastcache\Drivers\Zenddisk; |
16 | 16 |
@@ -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 | } |
@@ -11,7 +11,7 @@ |
||
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\Util; |
17 | 17 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | return true; |
42 | 42 | } else if (\constant($CONSTANT_NAME) !== $driverName) { |
43 | 43 | trigger_error('Memcache collision detected, you used both Memcache and Memcached driver in your script, this may leads to unexpected behaviours', |
44 | - E_USER_WARNING); |
|
44 | + E_USER_WARNING); |
|
45 | 45 | |
46 | 46 | return false; |
47 | 47 | } |
@@ -11,7 +11,7 @@ |
||
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\Core\Item; |
17 | 17 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
19 | 19 | use Phpfastcache\EventManager; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | use Phpfastcache\Core\Item\ExtendedCacheItemInterface; |
20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheDriverCheckException, PhpfastcacheInvalidArgumentException, PhpfastcacheRootException, PhpfastcacheSimpleCacheException |
|
22 | + PhpfastcacheDriverCheckException, PhpfastcacheInvalidArgumentException, PhpfastcacheRootException, PhpfastcacheSimpleCacheException |
|
23 | 23 | }; |
24 | 24 | use Psr\SimpleCache\CacheInterface; |
25 | 25 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | { |
77 | 77 | try { |
78 | 78 | $cacheItem = $this->internalCacheInstance |
79 | - ->getItem($key) |
|
80 | - ->set($value); |
|
79 | + ->getItem($key) |
|
80 | + ->set($value); |
|
81 | 81 | if (\is_int($ttl) && $ttl <= 0) { |
82 | 82 | $cacheItem->expiresAt((new \DateTime('@0'))); |
83 | 83 | } elseif (\is_int($ttl) || $ttl instanceof \DateInterval) { |
@@ -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\Helper; |
17 | 17 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | public function getMultiple($keys, $default = null) |
126 | 126 | { |
127 | 127 | try { |
128 | - return array_map(function (ExtendedCacheItemInterface $item) { |
|
128 | + return array_map(function(ExtendedCacheItemInterface $item) { |
|
129 | 129 | return $item->get(); |
130 | 130 | }, $this->internalCacheInstance->getItems($keys)); |
131 | 131 | } catch (PhpfastcacheInvalidArgumentException $e) { |
@@ -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, PhpfastcacheDriverCheckException, PhpfastcacheDriverException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheDriverException |
|
22 | 22 | }; |
23 | 23 | use Phpfastcache\Util\ArrayObject; |
24 | 24 | use phpssdb\Core\{SimpleSSDB, SSDBException}; |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | * using hardcoded offset of pair key-value :-( |
148 | 148 | */ |
149 | 149 | $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[ 2 ], $info[ 6 ])) |
150 | - ->setRawData($info) |
|
151 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
152 | - ->setSize($this->instance->dbsize()); |
|
150 | + ->setRawData($info) |
|
151 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
152 | + ->setSize($this->instance->dbsize()); |
|
153 | 153 | |
154 | 154 | return $stat; |
155 | 155 | } |
@@ -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\Ssdb; |
17 | 17 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * Data returned by Ssdb are very poorly formatted |
147 | 147 | * using hardcoded offset of pair key-value :-( |
148 | 148 | */ |
149 | - $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[ 2 ], $info[ 6 ])) |
|
149 | + $stat->setInfo(\sprintf("Ssdb-server v%s with a total of %s call(s).\n For more information see RawData.", $info[2], $info[6])) |
|
150 | 150 | ->setRawData($info) |
151 | 151 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
152 | 152 | ->setSize($this->instance->dbsize()); |
@@ -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 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use LevelDB as LeveldbClient; |
19 | 19 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface, IO\IOHelperTrait}; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 |
@@ -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\Leveldb; |
17 | 17 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * Check for Cross-Driver type confusion |
85 | 85 | */ |
86 | 86 | if ($item instanceof Item) { |
87 | - return (bool)$this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
87 | + return (bool) $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->instance->close(); |
117 | 117 | $this->instance = null; |
118 | 118 | } |
119 | - $result = (bool)LeveldbClient::destroy($this->getLeveldbFile()); |
|
119 | + $result = (bool) LeveldbClient::destroy($this->getLeveldbFile()); |
|
120 | 120 | $this->driverConnect(); |
121 | 121 | |
122 | 122 | return $result; |
@@ -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 | |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
134 | 134 | |
135 | 135 | return (new DriverStatistic()) |
136 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
137 | - ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
136 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
137 | + ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
|
138 | 138 | $stats[ 'num_entries' ])) |
139 | - ->setRawData($stats) |
|
140 | - ->setSize($stats[ 'mem_size' ]); |
|
139 | + ->setRawData($stats) |
|
140 | + ->setSize($stats[ 'mem_size' ]); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | \ 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\Apc; |
17 | 17 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($item instanceof Item) { |
88 | 88 | $ttl = $item->getExpirationDate()->getTimestamp() - \time(); |
89 | 89 | |
90 | - return (bool)apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
90 | + return (bool) apc_store($item->getKey(), $this->driverPreWrap($item), ($ttl > 0 ? $ttl : 0)); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * Check for Cross-Driver type confusion |
105 | 105 | */ |
106 | 106 | if ($item instanceof Item) { |
107 | - return (bool)apc_delete($item->getKey()); |
|
107 | + return (bool) apc_delete($item->getKey()); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function getStats(): DriverStatistic |
131 | 131 | { |
132 | - $stats = (array)apc_cache_info('user'); |
|
133 | - $date = (new \DateTime())->setTimestamp($stats[ 'start_time' ]); |
|
132 | + $stats = (array) apc_cache_info('user'); |
|
133 | + $date = (new \DateTime())->setTimestamp($stats['start_time']); |
|
134 | 134 | |
135 | 135 | return (new DriverStatistic()) |
136 | 136 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
137 | 137 | ->setInfo(\sprintf("The APC cache is up since %s, and have %d item(s) in cache.\n For more information see RawData.", $date->format(DATE_RFC2822), |
138 | - $stats[ 'num_entries' ])) |
|
138 | + $stats['num_entries'])) |
|
139 | 139 | ->setRawData($stats) |
140 | - ->setSize($stats[ 'mem_size' ]); |
|
140 | + ->setSize($stats['mem_size']); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | \ No newline at end of file |