@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | $this->instance->authenticate($authenticator); |
| 80 | 80 | |
| 81 | 81 | foreach ($clientConfig->getBuckets() as $bucket) { |
| 82 | - $this->currentBucket = $this->currentBucket ?: $bucket[ 'bucket' ]; |
|
| 83 | - $this->setBucket($bucket[ 'bucket' ], $this->instance->openBucket($bucket[ 'bucket' ])); |
|
| 82 | + $this->currentBucket = $this->currentBucket ?: $bucket['bucket']; |
|
| 83 | + $this->setBucket($bucket['bucket'], $this->instance->openBucket($bucket['bucket'])); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return true; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | if ($item instanceof Item) { |
| 116 | 116 | try { |
| 117 | - return (bool)$this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]); |
|
| 117 | + return (bool) $this->getBucket()->upsert($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), ['expiry' => $item->getTtl()]); |
|
| 118 | 118 | } catch (\CouchbaseException $e) { |
| 119 | 119 | return false; |
| 120 | 120 | } |
@@ -134,9 +134,9 @@ discard block |
||
| 134 | 134 | * Check for Cross-Driver type confusion |
| 135 | 135 | */ |
| 136 | 136 | if ($item instanceof Item) { |
| 137 | - try{ |
|
| 138 | - return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
|
| 139 | - }catch (\Couchbase\Exception $e){ |
|
| 137 | + try { |
|
| 138 | + return (bool) $this->getBucket()->remove($item->getEncodedKey()); |
|
| 139 | + } catch (\Couchbase\Exception $e) { |
|
| 140 | 140 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | protected function getBucket(): \CouchbaseBucket |
| 160 | 160 | { |
| 161 | - return $this->bucketInstances[ $this->currentBucket ]; |
|
| 161 | + return $this->bucketInstances[$this->currentBucket]; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | protected function setBucket($bucketName, \CouchbaseBucket $CouchbaseBucket) |
| 170 | 170 | { |
| 171 | 171 | if (!\array_key_exists($bucketName, $this->bucketInstances)) { |
| 172 | - $this->bucketInstances[ $bucketName ] = $CouchbaseBucket; |
|
| 172 | + $this->bucketInstances[$bucketName] = $CouchbaseBucket; |
|
| 173 | 173 | } else { |
| 174 | 174 | throw new PhpfastcacheLogicException('A bucket instance with this name already exists.'); |
| 175 | 175 | } |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | $info = $this->getBucket()->manager()->info(); |
| 190 | 190 | |
| 191 | 191 | return (new DriverStatistic()) |
| 192 | - ->setSize($info[ 'basicStats' ][ 'diskUsed' ]) |
|
| 192 | + ->setSize($info['basicStats']['diskUsed']) |
|
| 193 | 193 | ->setRawData($info) |
| 194 | 194 | ->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 195 | - ->setInfo('CouchBase version ' . $info[ 'nodes' ][ 0 ][ 'version' ] . ', Uptime (in days): ' . round($info[ 'nodes' ][ 0 ][ 'uptime' ] / 86400, |
|
| 195 | + ->setInfo('CouchBase version ' . $info['nodes'][0]['version'] . ', Uptime (in days): ' . round($info['nodes'][0]['uptime'] / 86400, |
|
| 196 | 196 | 1) . "\n For more information see RawData."); |
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | \ No newline at end of file |