@@ -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\Memcache; |
17 | 17 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Memcache\Driver as MemcacheDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -16,12 +16,12 @@ |
||
16 | 16 | * @var array |
17 | 17 | */ |
18 | 18 | protected $servers = [ |
19 | - [ |
|
19 | + [ |
|
20 | 20 | 'host' => '127.0.0.1', |
21 | 21 | 'port' => 11211, |
22 | 22 | 'saslUser' => false, |
23 | 23 | 'saslPassword' => false, |
24 | - ], |
|
24 | + ], |
|
25 | 25 | ]; |
26 | 26 | |
27 | 27 | /** |
@@ -152,7 +152,7 @@ |
||
152 | 152 | */ |
153 | 153 | if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){ |
154 | 154 | $this->fallback = true; |
155 | - }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) { |
|
155 | + } else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) { |
|
156 | 156 | $this->fallback = true; |
157 | 157 | } |
158 | 158 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
21 | 21 | use Phpfastcache\Entities\DriverStatistic; |
22 | 22 | use Phpfastcache\Exceptions\{ |
23 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
23 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
24 | 24 | }; |
25 | 25 | use Phpfastcache\Util\{ArrayObject, MemcacheDriverCollisionDetectorTrait}; |
26 | 26 | use Psr\Cache\CacheItemInterface; |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | $servers = (!empty($this->config->getOption('servers')) && \is_array($this->config->getOption('servers')) ? $this->config->getOption('servers') : []); |
74 | 74 | if (\count($servers) < 1) { |
75 | 75 | $servers = [ |
76 | - [ |
|
76 | + [ |
|
77 | 77 | 'host' => !empty($this->config->getOption('host')) ? $this->config->getOption('host') : '127.0.0.1', |
78 | 78 | 'path' => !empty($this->config->getOption('path')) ? $this->config->getOption('path') : false, |
79 | 79 | 'port' => !empty($this->config->getOption('port')) ? $this->config->getOption('port') : 11211, |
80 | 80 | 'saslUser' => !empty($this->config->getOption('saslUser')) ? $this->config->getOption('saslUser') : false, |
81 | 81 | 'saslPassword' =>!empty($this->config->getOption('saslPassword')) ? $this->config->getOption('saslPassword'): false, |
82 | - ], |
|
82 | + ], |
|
83 | 83 | ]; |
84 | 84 | } |
85 | 85 | |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]); |
197 | 197 | |
198 | 198 | return (new DriverStatistic()) |
199 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
200 | - ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
201 | - ->setRawData($stats) |
|
202 | - ->setSize((int)$stats[ 'bytes' ]); |
|
199 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
200 | + ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
201 | + ->setRawData($stats) |
|
202 | + ->setSize((int)$stats[ 'bytes' ]); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | \ 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\Memcache; |
17 | 17 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | 'path' => !empty($this->config->getOption('path')) ? $this->config->getOption('path') : false, |
79 | 79 | 'port' => !empty($this->config->getOption('port')) ? $this->config->getOption('port') : 11211, |
80 | 80 | 'saslUser' => !empty($this->config->getOption('saslUser')) ? $this->config->getOption('saslUser') : false, |
81 | - 'saslPassword' =>!empty($this->config->getOption('saslPassword')) ? $this->config->getOption('saslPassword'): false, |
|
81 | + 'saslPassword' =>!empty($this->config->getOption('saslPassword')) ? $this->config->getOption('saslPassword') : false, |
|
82 | 82 | ], |
83 | 83 | ]; |
84 | 84 | } |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | /** |
89 | 89 | * If path is provided we consider it as an UNIX Socket |
90 | 90 | */ |
91 | - if(!empty($server[ 'path' ]) && !$this->instance->addServer($server[ 'path' ], 0)){ |
|
91 | + if (!empty($server['path']) && !$this->instance->addServer($server['path'], 0)) { |
|
92 | 92 | $this->fallback = true; |
93 | - }else if (!empty($server[ 'host' ]) && !$this->instance->addServer($server[ 'host' ], $server[ 'port' ])) { |
|
93 | + } else if (!empty($server['host']) && !$this->instance->addServer($server['host'], $server['port'])) { |
|
94 | 94 | $this->fallback = true; |
95 | 95 | } |
96 | 96 | |
97 | - if (!empty($server[ 'saslUser' ]) && !empty($server[ 'saslPassword' ])) { |
|
97 | + if (!empty($server['saslUser']) && !empty($server['saslPassword'])) { |
|
98 | 98 | throw new PhpfastcacheDriverException('Unlike Memcached, Memcache does not support SASL authentication'); |
99 | 99 | } |
100 | 100 | } catch (\Exception $e) { |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * Since Memcached does not throw |
106 | 106 | * any error if not connected ... |
107 | 107 | */ |
108 | - if(!$this->instance->getServerStatus(!empty($server[ 'path' ]) ? $server[ 'path' ] : $server[ 'host' ], !empty($server[ 'port' ]) ? $server[ 'port' ] : 0)){ |
|
108 | + if (!$this->instance->getServerStatus(!empty($server['path']) ? $server['path'] : $server['host'], !empty($server['port']) ? $server['port'] : 0)) { |
|
109 | 109 | throw new PhpfastcacheDriverException('Memcache seems to not be connected'); |
110 | 110 | } |
111 | 111 | } |
@@ -188,17 +188,17 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function getStats(): DriverStatistic |
190 | 190 | { |
191 | - $stats = (array)$this->instance->getstats(); |
|
192 | - $stats[ 'uptime' ] = (isset($stats[ 'uptime' ]) ? $stats[ 'uptime' ] : 0); |
|
193 | - $stats[ 'version' ] = (isset($stats[ 'version' ]) ? $stats[ 'version' ] : 'UnknownVersion'); |
|
194 | - $stats[ 'bytes' ] = (isset($stats[ 'bytes' ]) ? $stats[ 'version' ] : 0); |
|
191 | + $stats = (array) $this->instance->getstats(); |
|
192 | + $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0); |
|
193 | + $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion'); |
|
194 | + $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0); |
|
195 | 195 | |
196 | - $date = (new \DateTime())->setTimestamp(time() - $stats[ 'uptime' ]); |
|
196 | + $date = (new \DateTime())->setTimestamp(time() - $stats['uptime']); |
|
197 | 197 | |
198 | 198 | return (new DriverStatistic()) |
199 | 199 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
200 | - ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats[ 'version' ], $date->format(DATE_RFC2822))) |
|
200 | + ->setInfo(\sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822))) |
|
201 | 201 | ->setRawData($stats) |
202 | - ->setSize((int)$stats[ 'bytes' ]); |
|
202 | + ->setSize((int) $stats['bytes']); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | \ No newline at end of file |
@@ -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\Xcache; |
17 | 17 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Xcache\Driver as XcacheDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -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\Xcache; |
17 | 17 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $info = xcache_info(XC_TYPE_VAR, 0); |
126 | 126 | |
127 | 127 | return (new DriverStatistic()) |
128 | - ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
128 | + ->setSize(abs($info['size'] - $info['avail'])) |
|
129 | 129 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
130 | 130 | ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
131 | 131 | ->setRawData($info); |
@@ -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 | |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $info = xcache_info(XC_TYPE_VAR, 0); |
126 | 126 | |
127 | 127 | return (new DriverStatistic()) |
128 | - ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
129 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
130 | - ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
|
131 | - ->setRawData($info); |
|
128 | + ->setSize(abs($info[ 'size' ] - $info[ 'avail' ])) |
|
129 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
130 | + ->setInfo(\sprintf("Xcache v%s with following modules loaded:\n %s", XCACHE_VERSION, \str_replace(' ', ', ', XCACHE_MODULES))) |
|
131 | + ->setRawData($info); |
|
132 | 132 | } |
133 | 133 | throw new \RuntimeException("PhpFastCache is not able to read Xcache configuration. Please put this to your php.ini:\n |
134 | 134 | [xcache.admin] |
@@ -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\Cassandra; |
17 | 17 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
21 | 21 | use Phpfastcache\Drivers\Cassandra\Driver as CassandraDriver; |
22 | 22 | use Phpfastcache\Exceptions\{ |
23 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
23 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
24 | 24 | }; |
25 | 25 | |
26 | 26 | /** |
@@ -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\Cassandra; |
17 | 17 | |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $clientConfig = $this->getConfig(); |
62 | 62 | |
63 | 63 | $clusterBuilder = Cassandra::cluster() |
64 | - ->withContactPoints($clientConfig[ 'host' ]) |
|
65 | - ->withPort($clientConfig[ 'port' ]); |
|
64 | + ->withContactPoints($clientConfig['host']) |
|
65 | + ->withPort($clientConfig['port']); |
|
66 | 66 | |
67 | - if (!empty($clientConfig[ 'sslEnabled' ])) { |
|
68 | - if (!empty($clientConfig[ 'sslVerify' ])) { |
|
67 | + if (!empty($clientConfig['sslEnabled'])) { |
|
68 | + if (!empty($clientConfig['sslVerify'])) { |
|
69 | 69 | $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_PEER_CERT); |
70 | 70 | } else { |
71 | 71 | $sslBuilder = Cassandra::ssl()->withVerifyFlags(Cassandra::VERIFY_NONE); |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | $clusterBuilder->withSSL($sslBuilder->build()); |
75 | 75 | } |
76 | 76 | |
77 | - $clusterBuilder->withConnectTimeout($clientConfig[ 'timeout' ]); |
|
77 | + $clusterBuilder->withConnectTimeout($clientConfig['timeout']); |
|
78 | 78 | |
79 | - if ($clientConfig[ 'username' ]) { |
|
80 | - $clusterBuilder->withCredentials($clientConfig[ 'username' ], $clientConfig[ 'password' ]); |
|
79 | + if ($clientConfig['username']) { |
|
80 | + $clusterBuilder->withCredentials($clientConfig['username'], $clientConfig['password']); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $this->instance = $clusterBuilder->build()->connect(); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'arguments' => ['cache_id' => $item->getKey()], |
121 | 121 | 'page_size' => 1, |
122 | 122 | ]); |
123 | - $query =\sprintf( |
|
123 | + $query = \sprintf( |
|
124 | 124 | 'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;', |
125 | 125 | self::CASSANDRA_KEY_SPACE, |
126 | 126 | self::CASSANDRA_TABLE |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options); |
129 | 129 | |
130 | 130 | if ($results instanceof Cassandra\Rows && $results->count() === 1) { |
131 | - return $this->decode($results->first()[ 'cache_data' ]); |
|
131 | + return $this->decode($results->first()['cache_data']); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | return null; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | 'serial_consistency' => Cassandra::CONSISTENCY_SERIAL, |
164 | 164 | ]); |
165 | 165 | |
166 | - $query =\sprintf('INSERT INTO %s.%s |
|
166 | + $query = \sprintf('INSERT INTO %s.%s |
|
167 | 167 | ( |
168 | 168 | cache_uuid, |
169 | 169 | cache_id, |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | ))); |
279 | 279 | |
280 | 280 | return (new DriverStatistic()) |
281 | - ->setSize($result->first()[ 'cache_size' ]) |
|
281 | + ->setSize($result->first()['cache_size']) |
|
282 | 282 | ->setRawData([]) |
283 | 283 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
284 | 284 | ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.'); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
21 | 21 | use Phpfastcache\Entities\DriverStatistic; |
22 | 22 | use Phpfastcache\Exceptions\{ |
23 | - PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
23 | + PhpfastcacheInvalidArgumentException, PhpfastcacheLogicException |
|
24 | 24 | }; |
25 | 25 | use Phpfastcache\Util\ArrayObject; |
26 | 26 | use Psr\Cache\CacheItemInterface; |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | $clientConfig = $this->getConfig(); |
62 | 62 | |
63 | 63 | $clusterBuilder = Cassandra::cluster() |
64 | - ->withContactPoints($clientConfig[ 'host' ]) |
|
65 | - ->withPort($clientConfig[ 'port' ]); |
|
64 | + ->withContactPoints($clientConfig[ 'host' ]) |
|
65 | + ->withPort($clientConfig[ 'port' ]); |
|
66 | 66 | |
67 | 67 | if (!empty($clientConfig[ 'sslEnabled' ])) { |
68 | 68 | if (!empty($clientConfig[ 'sslVerify' ])) { |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | */ |
91 | 91 | |
92 | 92 | $this->instance->execute(new Cassandra\SimpleStatement(\sprintf( |
93 | - "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };", |
|
94 | - self::CASSANDRA_KEY_SPACE |
|
93 | + "CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };", |
|
94 | + self::CASSANDRA_KEY_SPACE |
|
95 | 95 | ))); |
96 | 96 | $this->instance->execute(new Cassandra\SimpleStatement(\sprintf('USE %s;', self::CASSANDRA_KEY_SPACE))); |
97 | 97 | $this->instance->execute(new Cassandra\SimpleStatement(\sprintf(' |
@@ -117,13 +117,13 @@ discard block |
||
117 | 117 | { |
118 | 118 | try { |
119 | 119 | $options = new Cassandra\ExecutionOptions([ |
120 | - 'arguments' => ['cache_id' => $item->getKey()], |
|
121 | - 'page_size' => 1, |
|
120 | + 'arguments' => ['cache_id' => $item->getKey()], |
|
121 | + 'page_size' => 1, |
|
122 | 122 | ]); |
123 | 123 | $query =\sprintf( |
124 | - 'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;', |
|
125 | - self::CASSANDRA_KEY_SPACE, |
|
126 | - self::CASSANDRA_TABLE |
|
124 | + 'SELECT cache_data FROM %s.%s WHERE cache_id = :cache_id;', |
|
125 | + self::CASSANDRA_KEY_SPACE, |
|
126 | + self::CASSANDRA_TABLE |
|
127 | 127 | ); |
128 | 128 | $results = $this->instance->execute(new Cassandra\SimpleStatement($query), $options); |
129 | 129 | |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | try { |
152 | 152 | $cacheData = $this->encode($this->driverPreWrap($item)); |
153 | 153 | $options = new Cassandra\ExecutionOptions([ |
154 | - 'arguments' => [ |
|
154 | + 'arguments' => [ |
|
155 | 155 | 'cache_uuid' => new Cassandra\Uuid(), |
156 | 156 | 'cache_id' => $item->getKey(), |
157 | 157 | 'cache_data' => $cacheData, |
158 | 158 | 'cache_creation_date' => new Cassandra\Timestamp((new \DateTime())->getTimestamp()), |
159 | 159 | 'cache_expiration_date' => new Cassandra\Timestamp($item->getExpirationDate()->getTimestamp()), |
160 | 160 | 'cache_length' => strlen($cacheData), |
161 | - ], |
|
162 | - 'consistency' => Cassandra::CONSISTENCY_ALL, |
|
163 | - 'serial_consistency' => Cassandra::CONSISTENCY_SERIAL, |
|
161 | + ], |
|
162 | + 'consistency' => Cassandra::CONSISTENCY_ALL, |
|
163 | + 'serial_consistency' => Cassandra::CONSISTENCY_SERIAL, |
|
164 | 164 | ]); |
165 | 165 | |
166 | 166 | $query =\sprintf('INSERT INTO %s.%s |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | if ($item instanceof Item) { |
204 | 204 | try { |
205 | 205 | $options = new Cassandra\ExecutionOptions([ |
206 | - 'arguments' => [ |
|
206 | + 'arguments' => [ |
|
207 | 207 | 'cache_id' => $item->getKey(), |
208 | - ], |
|
208 | + ], |
|
209 | 209 | ]); |
210 | 210 | $result = $this->instance->execute(new Cassandra\SimpleStatement(\sprintf( |
211 | - 'DELETE FROM %s.%s WHERE cache_id = :cache_id;', |
|
212 | - self::CASSANDRA_KEY_SPACE, |
|
213 | - self::CASSANDRA_TABLE |
|
211 | + 'DELETE FROM %s.%s WHERE cache_id = :cache_id;', |
|
212 | + self::CASSANDRA_KEY_SPACE, |
|
213 | + self::CASSANDRA_TABLE |
|
214 | 214 | )), $options); |
215 | 215 | |
216 | 216 | /** |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | { |
235 | 235 | try { |
236 | 236 | $this->instance->execute(new Cassandra\SimpleStatement(\sprintf( |
237 | - 'TRUNCATE %s.%s;', |
|
238 | - self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE |
|
237 | + 'TRUNCATE %s.%s;', |
|
238 | + self::CASSANDRA_KEY_SPACE, self::CASSANDRA_TABLE |
|
239 | 239 | ))); |
240 | 240 | |
241 | 241 | return true; |
@@ -272,15 +272,15 @@ discard block |
||
272 | 272 | public function getStats(): DriverStatistic |
273 | 273 | { |
274 | 274 | $result = $this->instance->execute(new Cassandra\SimpleStatement(\sprintf( |
275 | - 'SELECT SUM(cache_length) as cache_size FROM %s.%s', |
|
276 | - self::CASSANDRA_KEY_SPACE, |
|
277 | - self::CASSANDRA_TABLE |
|
275 | + 'SELECT SUM(cache_length) as cache_size FROM %s.%s', |
|
276 | + self::CASSANDRA_KEY_SPACE, |
|
277 | + self::CASSANDRA_TABLE |
|
278 | 278 | ))); |
279 | 279 | |
280 | 280 | return (new DriverStatistic()) |
281 | - ->setSize($result->first()[ 'cache_size' ]) |
|
282 | - ->setRawData([]) |
|
283 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
284 | - ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.'); |
|
281 | + ->setSize($result->first()[ 'cache_size' ]) |
|
282 | + ->setRawData([]) |
|
283 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
284 | + ->setInfo('The cache size represents only the cache data itself without counting data structures associated to the cache entries.'); |
|
285 | 285 | } |
286 | 286 | } |
287 | 287 | \ No newline at end of file |
@@ -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\Cookie; |
17 | 17 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
20 | 20 | use Phpfastcache\Drivers\Cookie\Driver as CookieDriver; |
21 | 21 | use Phpfastcache\Exceptions\{ |
22 | - PhpfastcacheInvalidArgumentException |
|
22 | + PhpfastcacheInvalidArgumentException |
|
23 | 23 | }; |
24 | 24 | |
25 | 25 | /** |
@@ -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\Cookie; |
17 | 17 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->driverConnect(); |
61 | 61 | $keyword = self::PREFIX . $item->getKey(); |
62 | - $x = isset($_COOKIE[ $keyword ]) ? \json_decode($_COOKIE[ $keyword ], true) : false; |
|
62 | + $x = isset($_COOKIE[$keyword]) ? \json_decode($_COOKIE[$keyword], true) : false; |
|
63 | 63 | |
64 | 64 | if ($x == false) { |
65 | 65 | return null; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $this->driverConnect(); |
106 | 106 | $keyword = self::PREFIX . $key; |
107 | - $x = isset($_COOKIE[ $keyword ]) ? $this->decode(\json_decode($_COOKIE[ $keyword ])->t) : 0; |
|
107 | + $x = isset($_COOKIE[$keyword]) ? $this->decode(\json_decode($_COOKIE[$keyword])->t) : 0; |
|
108 | 108 | |
109 | 109 | return $x ? $x - time() : $x; |
110 | 110 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if ($item instanceof Item) { |
123 | 123 | $this->driverConnect(); |
124 | 124 | $keyword = self::PREFIX . $item->getKey(); |
125 | - $_COOKIE[ $keyword ] = null; |
|
125 | + $_COOKIE[$keyword] = null; |
|
126 | 126 | |
127 | 127 | return @setcookie($keyword, null, -10); |
128 | 128 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $this->driverConnect(); |
140 | 140 | foreach ($_COOKIE as $keyword => $value) { |
141 | 141 | if (\strpos($keyword, self::PREFIX) !== false) { |
142 | - $_COOKIE[ $keyword ] = null; |
|
142 | + $_COOKIE[$keyword] = null; |
|
143 | 143 | $result = @setcookie($keyword, null, -10); |
144 | 144 | if ($return !== false) { |
145 | 145 | $return = $result; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface}; |
19 | 19 | use Phpfastcache\Entities\DriverStatistic; |
20 | 20 | use Phpfastcache\Exceptions\{ |
21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverException |
|
22 | 22 | }; |
23 | 23 | use Psr\Cache\CacheItemInterface; |
24 | 24 |