@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | if ($item instanceof Item) { |
| 166 | 166 | try { |
| 167 | - return (bool)$this->getBucket()->upsert( |
|
| 167 | + return (bool) $this->getBucket()->upsert( |
|
| 168 | 168 | $item->getEncodedKey(), |
| 169 | 169 | $this->encodeDocument($this->driverPreWrap($item)), |
| 170 | 170 | ['expiry' => $item->getTtl()] |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | if ($item instanceof Item) { |
| 191 | 191 | try { |
| 192 | - return (bool)$this->getBucket()->remove($item->getEncodedKey()); |
|
| 192 | + return (bool) $this->getBucket()->remove($item->getEncodedKey()); |
|
| 193 | 193 | } catch (Exception $e) { |
| 194 | 194 | return $e->getCode() === COUCHBASE_KEY_ENOENT; |
| 195 | 195 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $data[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX] = $this->encode($data[ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX]); |
| 208 | 208 | $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 209 | 209 | |
| 210 | - if($this->getConfig()->isItemDetailedDate()){ |
|
| 210 | + if ($this->getConfig()->isItemDetailedDate()) { |
|
| 211 | 211 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 212 | 212 | $data[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX] = $data[ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX]->format(\DateTime::ATOM); |
| 213 | 213 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $data[ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX] |
| 228 | 228 | ); |
| 229 | 229 | |
| 230 | - if($this->getConfig()->isItemDetailedDate()){ |
|
| 230 | + if ($this->getConfig()->isItemDetailedDate()) { |
|
| 231 | 231 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] = \DateTime::createFromFormat( |
| 232 | 232 | \DateTime::ATOM, |
| 233 | 233 | $data[ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX] |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Check for Cross-Driver type confusion |
| 82 | 82 | */ |
| 83 | 83 | if ($item instanceof Item) { |
| 84 | - return (bool)$this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
| 84 | + return (bool) $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $this->instance->close(); |
| 114 | 114 | $this->instance = null; |
| 115 | 115 | } |
| 116 | - $result = (bool)LeveldbClient::destroy($this->getLeveldbFile()); |
|
| 116 | + $result = (bool) LeveldbClient::destroy($this->getLeveldbFile()); |
|
| 117 | 117 | $this->driverConnect(); |
| 118 | 118 | |
| 119 | 119 | return $result; |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | throw new PhpfastcacheInvalidConfigurationException('Path must be a valid string in "$server" configuration array if host is not defined'); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port'])|| $server['port'] < 1)) { |
|
| 135 | + if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port']) || $server['port'] < 1)) { |
|
| 136 | 136 | throw new PhpfastcacheInvalidConfigurationException('Port must be a valid integer in "$server" configuration array'); |
| 137 | 137 | } |
| 138 | 138 | |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 79 | 79 | ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822))) |
| 80 | 80 | ->setRawData($stats) |
| 81 | - ->setSize((int)$stats['bytes']); |
|
| 81 | + ->setSize((int) $stats['bytes']); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return (new DriverStatistic()) |
| 56 | 56 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 57 | 57 | ->setRawData($info) |
| 58 | - ->setSize((int)$info['used_memory']) |
|
| 58 | + ->setSize((int) $info['used_memory']) |
|
| 59 | 59 | ->setInfo( |
| 60 | 60 | sprintf( |
| 61 | 61 | "The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | * Check for Cross-Driver type confusion |
| 170 | 170 | */ |
| 171 | 171 | if ($item instanceof Item) { |
| 172 | - return (bool)$this->instance->del($item->getKey()); |
|
| 172 | + return (bool) $this->instance->del($item->getKey()); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | return (new DriverStatistic()) |
| 76 | 76 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 77 | 77 | ->setRawData($info) |
| 78 | - ->setSize((int)$size) |
|
| 78 | + ->setSize((int) $size) |
|
| 79 | 79 | ->setInfo( |
| 80 | 80 | sprintf( |
| 81 | 81 | "The Redis daemon v%s is up since %s.\n For more information see RawData. \n Driver size includes the memory allocation size.", |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * @see https://redis.io/commands/expire |
| 173 | 173 | */ |
| 174 | 174 | if ($ttl <= 0) { |
| 175 | - return (bool)$this->instance->expire($item->getKey(), 0); |
|
| 175 | + return (bool) $this->instance->expire($item->getKey(), 0); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $this->instance->setex($item->getKey(), $ttl, $this->encode($this->driverPreWrap($item)))->getPayload() === 'OK'; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | * Check for Cross-Driver type confusion |
| 199 | 199 | */ |
| 200 | 200 | if ($item instanceof Item) { |
| 201 | - return (bool)$this->instance->del([$item->getKey()]); |
|
| 201 | + return (bool) $this->instance->del([$item->getKey()]); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); |
@@ -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 | }, |
@@ -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 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function getStats(): DriverStatistic |
| 74 | 74 | { |
| 75 | - $stats = (array)$this->instance->getstats(); |
|
| 75 | + $stats = (array) $this->instance->getstats(); |
|
| 76 | 76 | $stats['uptime'] = (isset($stats['uptime']) ? $stats['uptime'] : 0); |
| 77 | 77 | $stats['version'] = (isset($stats['version']) ? $stats['version'] : 'UnknownVersion'); |
| 78 | 78 | $stats['bytes'] = (isset($stats['bytes']) ? $stats['version'] : 0); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ->setData(implode(', ', array_keys($this->itemInstances))) |
| 84 | 84 | ->setInfo(sprintf("The memcache daemon v%s is up since %s.\n For more information see RawData.", $stats['version'], $date->format(DATE_RFC2822))) |
| 85 | 85 | ->setRawData($stats) |
| 86 | - ->setSize((int)$stats['bytes']); |
|
| 86 | + ->setSize((int) $stats['bytes']); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |