@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | if ($item instanceof Item) { |
| 156 | 156 | try { |
| 157 | - return (bool)$this->getBucket()->upsert( |
|
| 157 | + return (bool) $this->getBucket()->upsert( |
|
| 158 | 158 | $item->getEncodedKey(), |
| 159 | 159 | $this->encodeDocument($this->driverPreWrap($item)), |
| 160 | 160 | ['expiry' => $item->getTtl()] |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | if ($item instanceof Item) { |
| 181 | 181 | try { |
| 182 | - return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
|
| 182 | + return (bool) $this->getBucket()->remove($item->getEncodedKey()); |
|
| 183 | 183 | } catch (Exception $e) { |
| 184 | 184 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
| 185 | 185 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | $data[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX] = $this->encode($data[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX]); |
| 198 | 198 | $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 199 | 199 | |
| 200 | - if($this->getConfig()->isItemDetailedDate()){ |
|
| 200 | + if ($this->getConfig()->isItemDetailedDate()) { |
|
| 201 | 201 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 202 | 202 | $data[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 203 | 203 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX] |
| 218 | 218 | ); |
| 219 | 219 | |
| 220 | - if($this->getConfig()->isItemDetailedDate()){ |
|
| 220 | + if ($this->getConfig()->isItemDetailedDate()) { |
|
| 221 | 221 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = \DateTime::createFromFormat( |
| 222 | 222 | \DateTime::ATOM, |
| 223 | 223 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ) |
| 96 | 96 | )->toArray()[0]; |
| 97 | 97 | |
| 98 | - $array_filter_recursive = static function ($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 98 | + $array_filter_recursive = static function($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 99 | 99 | $array = $callback($array); |
| 100 | 100 | |
| 101 | 101 | if (\is_object($array) || \is_array($array)) { |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | return $array; |
| 108 | 108 | }; |
| 109 | 109 | |
| 110 | - $callback = static function ($item) { |
|
| 110 | + $callback = static function($item) { |
|
| 111 | 111 | /** |
| 112 | 112 | * Remove unserializable properties |
| 113 | 113 | */ |
| 114 | 114 | if ($item instanceof UTCDateTime) { |
| 115 | - return (string)$item; |
|
| 115 | + return (string) $item; |
|
| 116 | 116 | } |
| 117 | 117 | return $item; |
| 118 | 118 | }; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | self::DRIVER_CDATE_WRAPPER_INDEX => new UTCDateTime($item->getCreationDate()), |
| 202 | 202 | ]; |
| 203 | 203 | } |
| 204 | - $result = (array)$this->getCollection()->updateOne( |
|
| 204 | + $result = (array) $this->getCollection()->updateOne( |
|
| 205 | 205 | ['_id' => $this->getMongoDbItemKey($item)], |
| 206 | 206 | [ |
| 207 | 207 | '$set' => $set, |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $this->database->selectCollection($collectionName) |
| 282 | 282 | ->createIndex( |
| 283 | 283 | [self::DRIVER_EDATE_WRAPPER_INDEX => 1], |
| 284 | - ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 284 | + ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 285 | 285 | ); |
| 286 | 286 | } |
| 287 | 287 | |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | if (count($servers) > 0) { |
| 312 | 312 | $host = array_reduce( |
| 313 | 313 | $servers, |
| 314 | - static function ($carry, $data) { |
|
| 314 | + static function($carry, $data) { |
|
| 315 | 315 | $carry .= ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port']; |
| 316 | 316 | return $carry; |
| 317 | 317 | }, |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function getItemsByTagsAsJsonString(array $tagNames, int $option = 0, int $depth = 512, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): string |
| 36 | 36 | { |
| 37 | - $callback = static function (CacheItemInterface $item) { |
|
| 37 | + $callback = static function(CacheItemInterface $item) { |
|
| 38 | 38 | return $item->get(); |
| 39 | 39 | }; |
| 40 | 40 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | if (\is_string($tagName)) { |
| 88 | 88 | $driverResponse = $this->getItem($this->getTagKey($tagName)); |
| 89 | 89 | if ($driverResponse->isHit()) { |
| 90 | - $tagsItems = (array)$driverResponse->get(); |
|
| 90 | + $tagsItems = (array) $driverResponse->get(); |
|
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * getItems() may provides expired item(s) |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | return \array_filter( |
| 103 | 103 | $this->getItems(\array_unique(\array_keys($tagsItems))), |
| 104 | - static function (ExtendedCacheItemInterface $item) { |
|
| 104 | + static function(ExtendedCacheItemInterface $item) { |
|
| 105 | 105 | return $item->isHit(); |
| 106 | 106 | } |
| 107 | 107 | ); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - return (bool)$return; |
|
| 138 | + return (bool) $return; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - return (bool)$return; |
|
| 155 | + return (bool) $return; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | throw new PhpfastcacheInvalidArgumentException('$tagName must be a string'); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - return (bool)$return; |
|
| 190 | + return (bool) $return; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $this->saveDeferred($item); |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - return (bool)$this->commit(); |
|
| 204 | + return (bool) $this->commit(); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | throw new PhpfastcacheInvalidArgumentException('$tagName must be a string and $step an integer'); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - return (bool)$return; |
|
| 223 | + return (bool) $return; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->saveDeferred($item); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - return (bool)$this->commit(); |
|
| 237 | + return (bool) $this->commit(); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | throw new PhpfastcacheInvalidArgumentException('$tagName must be a string and $step an integer'); |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - return (bool)$return; |
|
| 256 | + return (bool) $return; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /** |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $this->saveDeferred($item); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - return (bool)$this->commit(); |
|
| 270 | + return (bool) $this->commit(); |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | throw new PhpfastcacheInvalidArgumentException('$tagName must be a string'); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - return (bool)$return; |
|
| 289 | + return (bool) $return; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $this->saveDeferred($item); |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - return (bool)$this->commit(); |
|
| 303 | + return (bool) $this->commit(); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | throw new PhpfastcacheInvalidArgumentException('$tagName must be a string'); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | * that has slow performances |
| 362 | 362 | */ |
| 363 | 363 | |
| 364 | - $tagsItem->set(\array_merge((array)$data, [$item->getKey() => $expTimestamp])) |
|
| 364 | + $tagsItem->set(\array_merge((array) $data, [$item->getKey() => $expTimestamp])) |
|
| 365 | 365 | ->expiresAt($item->getExpirationDate()); |
| 366 | 366 | |
| 367 | 367 | $this->driverWrite($tagsItem); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags())); |
| 376 | 376 | |
| 377 | 377 | foreach ($tagsItems as $tagsItem) { |
| 378 | - $data = (array)$tagsItem->get(); |
|
| 378 | + $data = (array) $tagsItem->get(); |
|
| 379 | 379 | |
| 380 | 380 | unset($data[$item->getKey()]); |
| 381 | 381 | $tagsItem->set($data); |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | protected function getTagKeys(array $keys): array |
| 407 | 407 | { |
| 408 | 408 | return \array_map( |
| 409 | - function (string $key) { |
|
| 409 | + function(string $key) { |
|
| 410 | 410 | return $this->getTagKey($key); |
| 411 | 411 | }, |
| 412 | 412 | $keys |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * CouchbaseBucket::get() returns a GetResult interface |
| 83 | 83 | */ |
| 84 | - return $this->decodeDocument((array)$this->getCollection()->get($item->getEncodedKey())->content()); |
|
| 84 | + return $this->decodeDocument((array) $this->getCollection()->get($item->getEncodedKey())->content()); |
|
| 85 | 85 | } catch (DocumentNotFoundException $e) { |
| 86 | 86 | return null; |
| 87 | 87 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | ->setSize(0) |
| 162 | 162 | ->setRawData($info) |
| 163 | 163 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 164 | - ->setInfo( $info['sdk'] . "\n For more information see RawData."); |
|
| 164 | + ->setInfo($info['sdk'] . "\n For more information see RawData."); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |