@@ -102,7 +102,7 @@ |
||
| 102 | 102 | 'notifier' => [ |
| 103 | 103 | 'info' => [ |
| 104 | 104 | 'files' => [ |
| 105 | - 'value' => 'dropdown', // static notifier |
|
| 105 | + 'value' => 'dropdown', // static notifier |
|
| 106 | 106 | ], |
| 107 | 107 | ], |
| 108 | 108 | ], |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $config = self::validateConfig($config); |
| 160 | 160 | $driver = self::standardizeDriverName($driver); |
| 161 | 161 | |
| 162 | - $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static function ($val) { |
|
| 162 | + $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static function($val) { |
|
| 163 | 163 | return !\is_callable($val); |
| 164 | 164 | }))); |
| 165 | 165 | |
@@ -181,9 +181,7 @@ discard block |
||
| 181 | 181 | See https://github.com/PHPSocialNetwork/phpfastcache/wiki/[V5]-Why-calling-getInstance%28%29-each-time-is-a-bad-practice-%3F' |
| 182 | 182 | ); |
| 183 | 183 | } |
| 184 | - } |
|
| 185 | - |
|
| 186 | - ++self::$badPracticeOmeter[$driver]; |
|
| 184 | + }++self::$badPracticeOmeter[$driver]; |
|
| 187 | 185 | |
| 188 | 186 | return self::$instances[$instanceId]; |
| 189 | 187 | } |
@@ -237,7 +235,7 @@ discard block |
||
| 237 | 235 | $found = false; |
| 238 | 236 | self::$instances = \array_filter( |
| 239 | 237 | \array_map( |
| 240 | - static function (ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
| 238 | + static function(ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
| 241 | 239 | if (\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)) { |
| 242 | 240 | $found = true; |
| 243 | 241 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function getItem($key) { |
| 51 | 51 | return $this->getStandardizedItem( |
| 52 | 52 | $this->makeOperation( |
| 53 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 53 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 54 | 54 | return $pool->getItem($key); |
| 55 | 55 | } |
| 56 | 56 | ) ?? new Item($this, $key), |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function hasItem($key) { |
| 65 | 65 | return $this->makeOperation( |
| 66 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 66 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 67 | 67 | return $pool->hasItem($key); |
| 68 | 68 | } |
| 69 | 69 | ); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function clear() { |
| 76 | 76 | return $this->makeOperation( |
| 77 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
| 77 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
| 78 | 78 | return $pool->clear(); |
| 79 | 79 | } |
| 80 | 80 | ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public function deleteItem($key) { |
| 87 | 87 | return $this->makeOperation( |
| 88 | - static function (ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 88 | + static function(ExtendedCacheItemPoolInterface $pool) use ($key) { |
|
| 89 | 89 | return $pool->deleteItem($key); |
| 90 | 90 | } |
| 91 | 91 | ); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function save(CacheItemInterface $item) { |
| 98 | 98 | return $this->makeOperation( |
| 99 | - function (ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
| 99 | + function(ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
| 100 | 100 | $item->setHit(true); |
| 101 | 101 | |
| 102 | 102 | return $pool->save($this->getStandardizedItem($item, $pool)); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function commit() { |
| 111 | 111 | return $this->makeOperation( |
| 112 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
| 112 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
| 113 | 113 | return $pool->commit(); |
| 114 | 114 | } |
| 115 | 115 | ); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | \implode( |
| 151 | 151 | ', ', |
| 152 | 152 | \array_map( |
| 153 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
| 153 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
| 154 | 154 | return \get_class($pool); |
| 155 | 155 | }, |
| 156 | 156 | $this->clusterPools |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $stats->setSize( |
| 163 | 163 | (int) \array_sum( |
| 164 | 164 | \array_map( |
| 165 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
| 165 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
| 166 | 166 | return $pool->getStats()->getSize(); |
| 167 | 167 | }, |
| 168 | 168 | $this->clusterPools |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | $stats->setData( |
| 174 | 174 | (int) \array_map( |
| 175 | - static function (ExtendedCacheItemPoolInterface $pool) { |
|
| 175 | + static function(ExtendedCacheItemPoolInterface $pool) { |
|
| 176 | 176 | return $pool->getStats()->getData(); |
| 177 | 177 | }, |
| 178 | 178 | $this->clusterPools |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | |
| 149 | 149 | try { |
| 150 | 150 | return \array_map( |
| 151 | - static function (ExtendedCacheItemInterface $item) use ($default) { |
|
| 151 | + static function(ExtendedCacheItemInterface $item) use ($default) { |
|
| 152 | 152 | return $item->isHit() ? $item->get() : $default; |
| 153 | 153 | }, |
| 154 | 154 | $this->internalCacheInstance->getItems($keys) |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ) |
| 93 | 93 | )->toArray()[0]; |
| 94 | 94 | |
| 95 | - $array_filter_recursive = static function ($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 95 | + $array_filter_recursive = static function($array, callable $callback = null) use (&$array_filter_recursive) { |
|
| 96 | 96 | $array = $callback($array); |
| 97 | 97 | |
| 98 | 98 | if (\is_object($array) || \is_array($array)) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | return $array; |
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | - $callback = static function ($item) { |
|
| 107 | + $callback = static function($item) { |
|
| 108 | 108 | /* |
| 109 | 109 | * Remove unserializable properties |
| 110 | 110 | */ |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $this->database->selectCollection($collectionName) |
| 266 | 266 | ->createIndex( |
| 267 | 267 | [self::DRIVER_EDATE_WRAPPER_INDEX => 1], |
| 268 | - ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 268 | + ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
| 269 | 269 | ) |
| 270 | 270 | ; |
| 271 | 271 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | if (count($servers) > 0) { |
| 295 | 295 | $host = array_reduce( |
| 296 | 296 | $servers, |
| 297 | - static function ($carry, $data) { |
|
| 297 | + static function($carry, $data) { |
|
| 298 | 298 | $carry .= ('' === $carry ? '' : ',') . $data['host'] . ':' . $data['port']; |
| 299 | 299 | |
| 300 | 300 | return $carry; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * Register Autoload |
| 27 | 27 | */ |
| 28 | 28 | spl_autoload_register( |
| 29 | - static function ($entity): void { |
|
| 29 | + static function($entity): void { |
|
| 30 | 30 | $module = explode('\\', $entity, 2); |
| 31 | 31 | if (!\in_array($module[0], ['Phpfastcache', 'Psr'])) { |
| 32 | 32 | /* |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | * {@inheritdoc} |
| 34 | 34 | */ |
| 35 | 35 | public function getItemsAsJsonString(array $keys = [], int $option = 0, int $depth = 512): string { |
| 36 | - $callback = static function (CacheItemInterface $item) { |
|
| 36 | + $callback = static function(CacheItemInterface $item) { |
|
| 37 | 37 | return $item->get(); |
| 38 | 38 | }; |
| 39 | 39 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * {@inheritdoc} |
| 31 | 31 | */ |
| 32 | 32 | public function getItemsByTagsAsJsonString(array $tagNames, int $option = 0, int $depth = 512, int $strategy = TaggableCacheItemPoolInterface::TAG_STRATEGY_ONE): string { |
| 33 | - $callback = static function (CacheItemInterface $item) { |
|
| 33 | + $callback = static function(CacheItemInterface $item) { |
|
| 34 | 34 | return $item->get(); |
| 35 | 35 | }; |
| 36 | 36 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | return \array_filter( |
| 273 | 273 | $this->getItems(\array_unique(\array_keys($tagsItems))), |
| 274 | - static function (ExtendedCacheItemInterface $item) { |
|
| 274 | + static function(ExtendedCacheItemInterface $item) { |
|
| 275 | 275 | return $item->isHit(); |
| 276 | 276 | } |
| 277 | 277 | ); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | protected function getTagKeys(array $keys): array { |
| 378 | 378 | return \array_map( |
| 379 | - function (string $key) { |
|
| 379 | + function(string $key) { |
|
| 380 | 380 | return $this->getTagKey($key); |
| 381 | 381 | }, |
| 382 | 382 | $keys |