@@ -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\Leveldb; |
| 17 | 17 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; |
| 20 | 20 | use Phpfastcache\Drivers\Leveldb\Driver as LeveldbDriver; |
| 21 | 21 | use Phpfastcache\Exceptions\{ |
| 22 | - PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 22 | + PhpfastcacheInvalidArgumentException, PhpfastcacheInvalidArgumentTypeException |
|
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /** |
@@ -14,4 +14,4 @@ |
||
| 14 | 14 | * @package phpFastCache\Config |
| 15 | 15 | * @see ConfigurationOption |
| 16 | 16 | */ |
| 17 | -class Config extends ConfigurationOption{} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class Config extends ConfigurationOption {} |
|
| 19 | 19 | \ No newline at end of file |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if(array_key_exists($property, $array)){ |
| 106 | 106 | $this->$property = &$array[ $property ]; |
| 107 | - }else{ |
|
| 107 | + } else{ |
|
| 108 | 108 | $array[ $property ] = &$this->$property; |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | $value = $this->{lcfirst(substr($method, 3))}; |
| 123 | 123 | $this->{$method}($value); |
| 124 | - }catch(\TypeError $e){ |
|
| 124 | + } catch(\TypeError $e){ |
|
| 125 | 125 | $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value); |
| 126 | 126 | $reflectionMethod = new \ReflectionMethod($this, $method); |
| 127 | 127 | $parameter = $reflectionMethod->getParameters()[0] ?? null; |
@@ -100,9 +100,9 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | if(array_diff_key($array, get_object_vars($this))){ |
| 102 | 102 | throw new PhpfastcacheInvalidConfigurationException(sprintf( |
| 103 | - 'Invalid option(s) for the config %s: %s', |
|
| 104 | - static::class, |
|
| 105 | - implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
| 103 | + 'Invalid option(s) for the config %s: %s', |
|
| 104 | + static::class, |
|
| 105 | + implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
| 106 | 106 | )); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | $typeHintExpected = ($parameter instanceof \ReflectionParameter ? ($parameter->getType() === 'object' ? $parameter->getClass() : $parameter->getType()) : 'Unknown type'); |
| 135 | 135 | |
| 136 | 136 | throw new PhpfastcacheInvalidConfigurationException(sprintf( |
| 137 | - 'Invalid type hint found for "%s", expected "%s" got "%s"', |
|
| 138 | - lcfirst(substr($method, 3)), |
|
| 139 | - $typeHintExpected, |
|
| 140 | - $typeHintGot |
|
| 137 | + 'Invalid type hint found for "%s", expected "%s" got "%s"', |
|
| 138 | + lcfirst(substr($method, 3)), |
|
| 139 | + $typeHintExpected, |
|
| 140 | + $typeHintGot |
|
| 141 | 141 | )); |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -326,9 +326,9 @@ discard block |
||
| 326 | 326 | { |
| 327 | 327 | if($fallbackConfig !== null && !($fallbackConfig instanceof self)){ |
| 328 | 328 | throw new PhpfastcacheInvalidArgumentException(sprintf( |
| 329 | - 'Invalid argument "%s" for %s', |
|
| 330 | - gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig), |
|
| 331 | - __METHOD__ |
|
| 329 | + 'Invalid argument "%s" for %s', |
|
| 330 | + gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig), |
|
| 331 | + __METHOD__ |
|
| 332 | 332 | )); |
| 333 | 333 | } |
| 334 | 334 | $this->fallbackConfig = $fallbackConfig; |
@@ -427,10 +427,10 @@ discard block |
||
| 427 | 427 | * by opening a pull request :) |
| 428 | 428 | */ |
| 429 | 429 | static $safeFileExtensions = [ |
| 430 | - 'txt', |
|
| 431 | - 'cache', |
|
| 432 | - 'db', |
|
| 433 | - 'pfc', |
|
| 430 | + 'txt', |
|
| 431 | + 'cache', |
|
| 432 | + 'db', |
|
| 433 | + 'pfc', |
|
| 434 | 434 | ]; |
| 435 | 435 | |
| 436 | 436 | if (\strpos($cacheFileExtension, '.') !== false) { |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | } |
| 439 | 439 | if (!\in_array($cacheFileExtension, $safeFileExtensions, true)) { |
| 440 | 440 | throw new PhpfastcacheInvalidConfigurationException( |
| 441 | - "{$cacheFileExtension} is not a safe extension, currently allowed extension: " . \implode(', ', $safeFileExtensions) |
|
| 441 | + "{$cacheFileExtension} is not a safe extension, currently allowed extension: " . \implode(', ', $safeFileExtensions) |
|
| 442 | 442 | ); |
| 443 | 443 | } |
| 444 | 444 | |
@@ -92,33 +92,33 @@ discard block |
||
| 92 | 92 | public function __construct(...$args) |
| 93 | 93 | { |
| 94 | 94 | parent::__construct(...$args); |
| 95 | - $array =& $this->getArray(); |
|
| 95 | + $array = & $this->getArray(); |
|
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | 98 | * Detect unwanted keys and throw an exception. |
| 99 | 99 | * No more kidding now, it's 21th century. |
| 100 | 100 | */ |
| 101 | - if(array_diff_key($array, get_object_vars($this))){ |
|
| 101 | + if (array_diff_key($array, get_object_vars($this))) { |
|
| 102 | 102 | throw new PhpfastcacheInvalidConfigurationException(sprintf( |
| 103 | 103 | 'Invalid option(s) for the config %s: %s', |
| 104 | 104 | static::class, |
| 105 | - implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
| 105 | + implode(', ', array_keys(array_diff_key($array, get_object_vars($this)))) |
|
| 106 | 106 | )); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | foreach (get_object_vars($this) as $property => $value) { |
| 110 | 110 | |
| 111 | - if(array_key_exists($property, $array)){ |
|
| 112 | - $this->$property = &$array[ $property ]; |
|
| 113 | - }else{ |
|
| 114 | - $array[ $property ] = &$this->$property; |
|
| 111 | + if (array_key_exists($property, $array)) { |
|
| 112 | + $this->$property = &$array[$property]; |
|
| 113 | + } else { |
|
| 114 | + $array[$property] = &$this->$property; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | foreach (get_class_methods($this) as $method) { |
| 119 | - if(strpos($method, 'set') === 0){ |
|
| 119 | + if (strpos($method, 'set') === 0) { |
|
| 120 | 120 | $value = null; |
| 121 | - try{ |
|
| 121 | + try { |
|
| 122 | 122 | /** |
| 123 | 123 | * We use property instead of getter |
| 124 | 124 | * because of is/get conditions and |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | $value = $this->{lcfirst(substr($method, 3))}; |
| 129 | 129 | $this->{$method}($value); |
| 130 | - }catch(\TypeError $e){ |
|
| 130 | + } catch (\TypeError $e) { |
|
| 131 | 131 | $typeHintGot = \is_object($value) ? \get_class($value) : \gettype($value); |
| 132 | 132 | $reflectionMethod = new \ReflectionMethod($this, $method); |
| 133 | 133 | $parameter = $reflectionMethod->getParameters()[0] ?? null; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | public function setFallbackConfig($fallbackConfig): self |
| 326 | 326 | { |
| 327 | - if($fallbackConfig !== null && !($fallbackConfig instanceof self)){ |
|
| 327 | + if ($fallbackConfig !== null && !($fallbackConfig instanceof self)) { |
|
| 328 | 328 | throw new PhpfastcacheInvalidArgumentException(sprintf( |
| 329 | 329 | 'Invalid argument "%s" for %s', |
| 330 | 330 | gettype($fallbackConfig) === 'object' ? get_class($fallbackConfig) : gettype($fallbackConfig), |
@@ -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\Helper; |
| 17 | 17 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | if (!$cacheItem->isHit()) { |
| 51 | 51 | $cacheItem->set($callback()); |
| 52 | - if($expiresAfter){ |
|
| 52 | + if ($expiresAfter) { |
|
| 53 | 53 | $cacheItem->expiresAfter($expiresAfter); |
| 54 | 54 | } |
| 55 | 55 | $this->cacheInstance->save($cacheItem); |
@@ -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\Helper; |
| 17 | 17 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __construct() |
| 39 | 39 | { |
| 40 | - $this->instances =& CacheManager::getInternalInstances(); |
|
| 40 | + $this->instances = & CacheManager::getInternalInstances(); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -45,11 +45,11 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected function getGenericCallback(): \Closure |
| 47 | 47 | { |
| 48 | - return function ($method, $args) { |
|
| 48 | + return function($method, $args) { |
|
| 49 | 49 | $return = []; |
| 50 | 50 | foreach ($this->instances as $instance) { |
| 51 | 51 | $reflectionMethod = new \ReflectionMethod(\get_class($instance), $method); |
| 52 | - $return[ $instance->getDriverName() ] = $reflectionMethod->invokeArgs($instance, $args); |
|
| 52 | + $return[$instance->getDriverName()] = $reflectionMethod->invokeArgs($instance, $args); |
|
| 53 | 53 | } |
| 54 | 54 | return $return; |
| 55 | 55 | }; |
@@ -62,5 +62,5 @@ |
||
| 62 | 62 | |
| 63 | 63 | if ((!\defined('PFC_IGNORE_COMPOSER_WARNING') || !PFC_IGNORE_COMPOSER_WARNING) && \class_exists('Composer\Autoload\ClassLoader')) { |
| 64 | 64 | trigger_error('Your project already makes use of Composer. You SHOULD use the composer dependency "phpfastcache/phpfastcache" instead of hard-autoloading.', |
| 65 | - E_USER_WARNING); |
|
| 65 | + E_USER_WARNING); |
|
| 66 | 66 | } |
| 67 | 67 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | namespace Phpfastcache\Autoload; |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | -class Autoload{} |
|
| 18 | +class Autoload {} |
|
| 19 | 19 | |
| 20 | 20 | \define('PFC_PHP_EXT', 'php'); |
| 21 | 21 | \define('PFC_BIN_DIR', __DIR__ . '/../../../bin/'); |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | /** |
| 25 | 25 | * Register Autoload |
| 26 | 26 | */ |
| 27 | -spl_autoload_register(function ($entity) { |
|
| 27 | +spl_autoload_register(function($entity) { |
|
| 28 | 28 | $module = \explode('\\', $entity, 2); |
| 29 | - if (!\in_array($module[ 0 ], ['Phpfastcache', 'Psr'])) { |
|
| 29 | + if (!\in_array($module[0], ['Phpfastcache', 'Psr'])) { |
|
| 30 | 30 | /** |
| 31 | 31 | * Not a part of phpFastCache file |
| 32 | 32 | * then we return here. |
@@ -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\Core\Item; |
| 17 | 17 | |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | protected static function cleanFileName($filename): string |
| 193 | 193 | { |
| 194 | 194 | $regex = [ |
| 195 | - '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
| 196 | - '/\.$/', |
|
| 197 | - '/^\./', |
|
| 195 | + '/[\?\[\]\/\\\=\<\>\:\;\,\'\"\&\$\#\*\(\)\|\~\`\!\{\}]/', |
|
| 196 | + '/\.$/', |
|
| 197 | + '/^\./', |
|
| 198 | 198 | ]; |
| 199 | 199 | $replace = ['-', '', '']; |
| 200 | 200 | |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $tmpFilename = Directory::getAbsolutePath(\dirname($file) . '/tmp_' . \md5( |
| 291 | 291 | str_shuffle(\uniqid($this->getDriverName(), false)) |
| 292 | 292 | . str_shuffle(\uniqid($this->getDriverName(), false)) |
| 293 | - )); |
|
| 293 | + )); |
|
| 294 | 294 | |
| 295 | 295 | $f = fopen($tmpFilename, 'w+'); |
| 296 | 296 | flock($f, LOCK_EX); |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $stat->setData(\implode(', ', \array_keys($this->itemInstances))) |
| 335 | - ->setRawData([ |
|
| 335 | + ->setRawData([ |
|
| 336 | 336 | 'tmp' => $this->tmp, |
| 337 | - ]) |
|
| 338 | - ->setSize(Directory::dirSize($path)) |
|
| 339 | - ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
| 337 | + ]) |
|
| 338 | + ->setSize(Directory::dirSize($path)) |
|
| 339 | + ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
| 340 | 340 | |
| 341 | 341 | return $stat; |
| 342 | 342 | } |
@@ -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\Core\Pool\IO; |
| 17 | 17 | |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $securityKey = \array_key_exists('securityKey', $this->config) ? $this->config->getOption('securityKey') : ''; |
| 56 | 56 | if (!$securityKey || mb_strtolower($securityKey) === 'auto') { |
| 57 | - if (isset($_SERVER[ 'HTTP_HOST' ])) { |
|
| 58 | - $securityKey = preg_replace('/^www./', '', \strtolower(\str_replace(':', '_', $_SERVER[ 'HTTP_HOST' ]))); |
|
| 57 | + if (isset($_SERVER['HTTP_HOST'])) { |
|
| 58 | + $securityKey = preg_replace('/^www./', '', \strtolower(\str_replace(':', '_', $_SERVER['HTTP_HOST']))); |
|
| 59 | 59 | } else { |
| 60 | 60 | $securityKey = ($this->isPHPModule() ? 'web' : 'cli'); |
| 61 | 61 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | return $full_path; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - if (!isset($this->tmp[ $full_path_hash ]) || (!@\file_exists($full_path) || !@\is_writable($full_path))) { |
|
| 101 | + if (!isset($this->tmp[$full_path_hash]) || (!@\file_exists($full_path) || !@\is_writable($full_path))) { |
|
| 102 | 102 | if (!@\file_exists($full_path)) { |
| 103 | 103 | @mkdir($full_path, $this->getDefaultChmod(), true); |
| 104 | 104 | } else if (!@\is_writable($full_path)) { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | throw new PhpfastcacheIOException('Path "' . $full_path . '" is not writable, please set a chmod 0777 or any writable permission and make sure to make use of an absolute path !'); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - $this->tmp[ $full_path_hash ] = $full_path; |
|
| 126 | + $this->tmp[$full_path_hash] = $full_path; |
|
| 127 | 127 | $this->htaccessGen($full_path, \array_key_exists('htaccess', $this->config) ? $this->config->getOption('htaccess') : false); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -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\Core\Pool; |
| 17 | 17 | |
@@ -167,15 +167,15 @@ discard block |
||
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | 169 | if ($this->config->getOption('itemDetailedDate')) { |
| 170 | - $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = new \DateTime(); |
|
| 170 | + $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = new \DateTime(); |
|
| 171 | 171 | /** |
| 172 | 172 | * If the creation date exists |
| 173 | 173 | * reuse it else set a new Date |
| 174 | 174 | */ |
| 175 | - $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = $item->getCreationDate() ?: new \DateTime(); |
|
| 175 | + $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = $item->getCreationDate() ?: new \DateTime(); |
|
| 176 | 176 | } else { |
| 177 | - $wrap[ self::DRIVER_MDATE_WRAPPER_INDEX ] = null; |
|
| 178 | - $wrap[ self::DRIVER_CDATE_WRAPPER_INDEX ] = null; |
|
| 177 | + $wrap[self::DRIVER_MDATE_WRAPPER_INDEX] = null; |
|
| 178 | + $wrap[self::DRIVER_CDATE_WRAPPER_INDEX] = null; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | return $wrap; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function driverUnwrapData(array $wrapper) |
| 189 | 189 | { |
| 190 | - return $wrapper[ self::DRIVER_DATA_WRAPPER_INDEX ]; |
|
| 190 | + return $wrapper[self::DRIVER_DATA_WRAPPER_INDEX]; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function driverUnwrapTags(array $wrapper) |
| 198 | 198 | { |
| 199 | - return $wrapper[ self::DRIVER_TAGS_WRAPPER_INDEX ]; |
|
| 199 | + return $wrapper[self::DRIVER_TAGS_WRAPPER_INDEX]; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function driverUnwrapEdate(array $wrapper) |
| 208 | 208 | { |
| 209 | - return $wrapper[ self::DRIVER_EDATE_WRAPPER_INDEX ]; |
|
| 209 | + return $wrapper[self::DRIVER_EDATE_WRAPPER_INDEX]; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /** |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function driverUnwrapCdate(array $wrapper) |
| 217 | 217 | { |
| 218 | - return $wrapper[ self::DRIVER_CDATE_WRAPPER_INDEX ]; |
|
| 218 | + return $wrapper[self::DRIVER_CDATE_WRAPPER_INDEX]; |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function driverUnwrapMdate(array $wrapper) |
| 227 | 227 | { |
| 228 | - return $wrapper[ self::DRIVER_MDATE_WRAPPER_INDEX ]; |
|
| 228 | + return $wrapper[self::DRIVER_MDATE_WRAPPER_INDEX]; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * that has slow performances |
| 283 | 283 | */ |
| 284 | 284 | |
| 285 | - $tagsItem->set(array_merge((array)$data, [$item->getKey() => $expTimestamp])); |
|
| 285 | + $tagsItem->set(array_merge((array) $data, [$item->getKey() => $expTimestamp])); |
|
| 286 | 286 | |
| 287 | 287 | /** |
| 288 | 288 | * Set the expiration date |
@@ -304,9 +304,9 @@ discard block |
||
| 304 | 304 | $tagsItems = $this->getItems($this->getTagKeys($item->getRemovedTags())); |
| 305 | 305 | |
| 306 | 306 | foreach ($tagsItems as $tagsItem) { |
| 307 | - $data = (array)$tagsItem->get(); |
|
| 307 | + $data = (array) $tagsItem->get(); |
|
| 308 | 308 | |
| 309 | - unset($data[ $item->getKey() ]); |
|
| 309 | + unset($data[$item->getKey()]); |
|
| 310 | 310 | $tagsItem->set($data); |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | public static function getConfigClass(): string |
| 388 | 388 | { |
| 389 | 389 | $localConfigClass = substr(static::class, 0, strrpos(static::class, '\\')) . '\Config'; |
| 390 | - if(\class_exists($localConfigClass) && is_a($localConfigClass, ConfigurationOption::class, true)){ |
|
| 390 | + if (\class_exists($localConfigClass) && is_a($localConfigClass, ConfigurationOption::class, true)) { |
|
| 391 | 391 | return $localConfigClass; |
| 392 | 392 | } |
| 393 | 393 | return ConfigurationOption::class; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | use Phpfastcache\Config\ConfigurationOption; |
| 19 | 19 | use Phpfastcache\Core\Item\ExtendedCacheItemInterface; |
| 20 | 20 | use Phpfastcache\Exceptions\{ |
| 21 | - PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheLogicException |
|
| 21 | + PhpfastcacheInvalidArgumentException, PhpfastcacheDriverCheckException, PhpfastcacheLogicException |
|
| 22 | 22 | }; |
| 23 | 23 | use Phpfastcache\Util\ArrayObject; |
| 24 | 24 | |
@@ -161,9 +161,9 @@ discard block |
||
| 161 | 161 | public function driverPreWrap(ExtendedCacheItemInterface $item): array |
| 162 | 162 | { |
| 163 | 163 | $wrap = [ |
| 164 | - self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
| 165 | - self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
| 166 | - self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(), |
|
| 164 | + self::DRIVER_DATA_WRAPPER_INDEX => $item->get(), |
|
| 165 | + self::DRIVER_TAGS_WRAPPER_INDEX => $item->getTags(), |
|
| 166 | + self::DRIVER_EDATE_WRAPPER_INDEX => $item->getExpirationDate(), |
|
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | 169 | if ($this->config->getOption('itemDetailedDate')) { |