@@ -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\Couchdb; |
| 17 | 17 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 21 | 21 | use Phpfastcache\Drivers\Couchdb\Driver as CouchdbDriver; |
| 22 | 22 | use Phpfastcache\Exceptions\{ |
| 23 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -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\Files; |
| 17 | 17 | |
@@ -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 | /** |
@@ -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\Files; |
| 17 | 17 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function driverClear(): bool |
| 145 | 145 | { |
| 146 | - return (bool)Directory::rrmdir($this->getPath(true)); |
|
| 146 | + return (bool) Directory::rrmdir($this->getPath(true)); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -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; |
@@ -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\Couchbase; |
| 17 | 17 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Couchbase\Driver as CouchbaseDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | 34 | protected $buckets = [ |
| 35 | - [ |
|
| 35 | + [ |
|
| 36 | 36 | 'bucket' => 'default', |
| 37 | 37 | 'password' => '', |
| 38 | - ], |
|
| 38 | + ], |
|
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | if ($item instanceof Item) { |
| 135 | 135 | try{ |
| 136 | 136 | return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
| 137 | - }catch (\Couchbase\Exception $e){ |
|
| 137 | + } catch (\Couchbase\Exception $e){ |
|
| 138 | 138 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | use CouchbaseCluster as CouchbaseClient; |
| 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; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | $info = $this->getBucket()->manager()->info(); |
| 188 | 188 | |
| 189 | 189 | return (new DriverStatistic()) |
| 190 | - ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
| 191 | - ->setRawData($info) |
|
| 192 | - ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 193 | - ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
| 194 | - 1) . "\n For more information see RawData."); |
|
| 190 | + ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
| 191 | + ->setRawData($info) |
|
| 192 | + ->setData(\implode(', ', \array_keys($this->itemInstances))) |
|
| 193 | + ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
| 194 | + 1) . "\n For more information see RawData."); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | \ 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\Couchbase; |
| 17 | 17 | |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | $this->instance = new CouchbaseClient("couchbase://{$clientConfig['host']}:{$clientConfig['port']}"); |
| 71 | 71 | |
| 72 | - if ($clientConfig[ 'username' ]) { |
|
| 72 | + if ($clientConfig['username']) { |
|
| 73 | 73 | $authenticator = new \Couchbase\ClassicAuthenticator(); |
| 74 | - $authenticator->cluster($clientConfig[ 'username' ], $clientConfig[ 'password' ]); |
|
| 74 | + $authenticator->cluster($clientConfig['username'], $clientConfig['password']); |
|
| 75 | 75 | //$authenticator->bucket('protected', 'secret'); |
| 76 | 76 | $this->instance->authenticate($authenticator); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - foreach ($clientConfig[ 'buckets' ] as $bucket) { |
|
| 80 | - $this->bucketCurrent = $this->bucketCurrent ?: $bucket[ 'bucket' ]; |
|
| 81 | - $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ], $bucket[ 'password' ])); |
|
| 79 | + foreach ($clientConfig['buckets'] as $bucket) { |
|
| 80 | + $this->bucketCurrent = $this->bucketCurrent ?: $bucket['bucket']; |
|
| 81 | + $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'], $bucket['password'])); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | return true; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | if ($item instanceof Item) { |
| 114 | 114 | try { |
| 115 | - return (bool)$this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]); |
|
| 115 | + return (bool) $this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]); |
|
| 116 | 116 | } catch (\CouchbaseException $e) { |
| 117 | 117 | return false; |
| 118 | 118 | } |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | * Check for Cross-Driver type confusion |
| 133 | 133 | */ |
| 134 | 134 | if ($item instanceof Item) { |
| 135 | - try{ |
|
| 136 | - return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
|
| 137 | - }catch (\Couchbase\Exception $e){ |
|
| 135 | + try { |
|
| 136 | + return (bool) $this->getBucket()->remove($item->getEncodedKey()); |
|
| 137 | + } catch (\Couchbase\Exception $e) { |
|
| 138 | 138 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected function getBucket(): \CouchbaseBucket |
| 158 | 158 | { |
| 159 | - return $this->bucketInstances[ $this->bucketCurrent ]; |
|
| 159 | + return $this->bucketInstances[$this->bucketCurrent]; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket) |
| 168 | 168 | { |
| 169 | 169 | if (!\array_key_exists($bucketName, $this->bucketInstances)) { |
| 170 | - $this->bucketInstances[ $bucketName ] = $CouchbaseBucket; |
|
| 170 | + $this->bucketInstances[$bucketName] = $CouchbaseBucket; |
|
| 171 | 171 | } else { |
| 172 | 172 | throw new PhpfastcacheLogicException('A bucket instance with this name already exists.'); |
| 173 | 173 | } |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | $info = $this->getBucket()->manager()->info(); |
| 188 | 188 | |
| 189 | 189 | return (new DriverStatistic()) |
| 190 | - ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
| 190 | + ->setSize($info['basicStats']['diskUsed']) |
|
| 191 | 191 | ->setRawData($info) |
| 192 | 192 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 193 | - ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
| 193 | + ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, |
|
| 194 | 194 | 1) . "\n For more information see RawData."); |
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | \ 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\Apcu; |
| 17 | 17 | |
@@ -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 | /** |
@@ -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\Devfalse; |
| 17 | 17 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 21 | 21 | use Phpfastcache\Drivers\Devfalse\Driver as DevfalseDriver; |
| 22 | 22 | use Phpfastcache\Exceptions\{ |
| 23 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -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 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Devnull\Driver as DevnullDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |