diff --git a/src/Module.php b/src/Module.php index 1306de71..41510f00 100644 --- a/src/Module.php +++ b/src/Module.php @@ -4,14 +4,11 @@ final class Module { - /** - * Return default laminas-cache configuration for laminas-mvc context. - */ public function getConfig(): array { - $provider = new ConfigProvider(); - return [ - 'service_manager' => $provider->getDependencyConfig(), - ]; + $config = (new ConfigProvider())(); + $config['service_manager'] = $config['dependencies']; + unset($config['dependencies']); + return $config; } } diff --git a/src/Pattern/CallbackCache.php b/src/Pattern/CallbackCache.php index 23fa08fe..d578305d 100644 --- a/src/Pattern/CallbackCache.php +++ b/src/Pattern/CallbackCache.php @@ -17,7 +17,7 @@ use function serialize; use function strtolower; -class CallbackCache extends AbstractStorageCapablePattern +final class CallbackCache extends AbstractStorageCapablePattern { /** * Call the specified callback or get the result from cache diff --git a/src/Pattern/CaptureCache.php b/src/Pattern/CaptureCache.php index dcda1b8e..41d25c9f 100644 --- a/src/Pattern/CaptureCache.php +++ b/src/Pattern/CaptureCache.php @@ -26,7 +26,7 @@ use const DIRECTORY_SEPARATOR; use const LOCK_EX; -class CaptureCache extends AbstractPattern +final class CaptureCache extends AbstractPattern { public function start(string|null $pageId = null): void { diff --git a/src/Pattern/ObjectCache.php b/src/Pattern/ObjectCache.php index 14df28a2..cbd12a28 100644 --- a/src/Pattern/ObjectCache.php +++ b/src/Pattern/ObjectCache.php @@ -17,7 +17,7 @@ use function sprintf; use function strtolower; -class ObjectCache extends AbstractStorageCapablePattern implements Stringable +final class ObjectCache extends AbstractStorageCapablePattern implements Stringable { private CallbackCache $callbackCache; diff --git a/src/Pattern/OutputCache.php b/src/Pattern/OutputCache.php index b3326d9f..a390bd0b 100644 --- a/src/Pattern/OutputCache.php +++ b/src/Pattern/OutputCache.php @@ -9,7 +9,7 @@ use function ob_implicit_flush; use function ob_start; -class OutputCache extends AbstractStorageCapablePattern +final class OutputCache extends AbstractStorageCapablePattern { /** * The key stack diff --git a/src/Psr/CacheItemPool/CacheItemPoolDecorator.php b/src/Psr/CacheItemPool/CacheItemPoolDecorator.php index 768bd518..dd41210d 100644 --- a/src/Psr/CacheItemPool/CacheItemPoolDecorator.php +++ b/src/Psr/CacheItemPool/CacheItemPoolDecorator.php @@ -37,7 +37,7 @@ * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-6-cache.md * @link https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-6-cache-meta.md */ -class CacheItemPoolDecorator implements CacheItemPoolInterface +final class CacheItemPoolDecorator implements CacheItemPoolInterface { use MaximumKeyLengthTrait; use SerializationTrait; @@ -373,8 +373,8 @@ private function validateKeys(array $keys): void } /** - * @psalm-param non-empty-list $items - * @psalm-return array + * @param non-empty-list $items + * @return array */ private function saveMultipleItems(array $items, ?int $itemTtl): array { diff --git a/src/Psr/MaximumKeyLengthTrait.php b/src/Psr/MaximumKeyLengthTrait.php index 18058dc4..6eaf9b78 100644 --- a/src/Psr/MaximumKeyLengthTrait.php +++ b/src/Psr/MaximumKeyLengthTrait.php @@ -29,11 +29,8 @@ trait MaximumKeyLengthTrait */ public static $pcreMaximumQuantifierLength = 65535; - /** - * @var int - * @psalm-var 0|positive-int - */ - private $maximumKeyLength; + /** @var int<0,max> */ + private int $maximumKeyLength; private function memoizeMaximumKeyLengthCapability(StorageInterface $storage, Capabilities $capabilities): void { diff --git a/src/Psr/SimpleCache/SimpleCacheDecorator.php b/src/Psr/SimpleCache/SimpleCacheDecorator.php index 3751b531..ab1e3bf7 100644 --- a/src/Psr/SimpleCache/SimpleCacheDecorator.php +++ b/src/Psr/SimpleCache/SimpleCacheDecorator.php @@ -34,7 +34,7 @@ /** * Decorate a laminas-cache storage adapter for usage as a PSR-16 implementation. */ -class SimpleCacheDecorator implements SimpleCacheInterface +final class SimpleCacheDecorator implements SimpleCacheInterface { use MaximumKeyLengthTrait; use SerializationTrait; @@ -385,7 +385,7 @@ private function convertTtlToInteger(int|DateInterval|null $ttl): int|null } /** - * @psalm-return list + * @return list * @throws SimpleCacheInvalidArgumentException For invalid $iterable values. */ private function convertIterableKeysToList(iterable $keys): array diff --git a/src/Service/StorageAdapterFactory.php b/src/Service/StorageAdapterFactory.php index 2e47bf8a..cd54d10f 100644 --- a/src/Service/StorageAdapterFactory.php +++ b/src/Service/StorageAdapterFactory.php @@ -94,8 +94,8 @@ public function assertValidConfigurationStructure(array $configuration): void } /** - * @psalm-param non-empty-string $adapter - * @psalm-param list $plugins + * @param non-empty-string $adapter + * @param list $plugins * @psalm-assert list $plugins */ private function assertValidPluginConfigurationStructure(string $adapter, array $plugins): void diff --git a/src/Service/StorageAdapterFactoryInterface.php b/src/Service/StorageAdapterFactoryInterface.php index 627e9bf6..088b2385 100644 --- a/src/Service/StorageAdapterFactoryInterface.php +++ b/src/Service/StorageAdapterFactoryInterface.php @@ -22,14 +22,14 @@ interface StorageAdapterFactoryInterface { /** - * @psalm-param StorageAdapterArrayConfigurationType $configuration + * @param StorageAdapterArrayConfigurationType $configuration */ public function createFromArrayConfiguration(array $configuration): StorageInterface; /** - * @psalm-param non-empty-string $storage + * @param non-empty-string $storage * @param array $options - * @psalm-param list $plugins + * @param list $plugins */ public function create(string $storage, array $options = [], array $plugins = []): StorageInterface; diff --git a/src/Service/StoragePluginFactoryInterface.php b/src/Service/StoragePluginFactoryInterface.php index 103a4859..0b3bc307 100644 --- a/src/Service/StoragePluginFactoryInterface.php +++ b/src/Service/StoragePluginFactoryInterface.php @@ -13,7 +13,7 @@ interface StoragePluginFactoryInterface { /** - * @psalm-param PluginArrayConfigurationType $configuration + * @param PluginArrayConfigurationType $configuration */ public function createFromArrayConfiguration(array $configuration): PluginInterface; diff --git a/src/Storage/Adapter/KeyListIterator.php b/src/Storage/Adapter/KeyListIterator.php index 4e2fd835..6ec8a474 100644 --- a/src/Storage/Adapter/KeyListIterator.php +++ b/src/Storage/Adapter/KeyListIterator.php @@ -5,17 +5,14 @@ use Countable; use Laminas\Cache\Storage\IteratorInterface; use Laminas\Cache\Storage\StorageInterface; -use ReturnTypeWillChange; use function count; /** - * @see ReturnTypeWillChange - * * @template-covariant TValue * @template-implements IteratorInterface */ -class KeyListIterator implements IteratorInterface, Countable +final class KeyListIterator implements IteratorInterface, Countable { /** * The iterator mode diff --git a/src/Storage/Plugin/ClearExpiredByFactor.php b/src/Storage/Plugin/ClearExpiredByFactor.php index af6c6d1a..98cfcaf8 100644 --- a/src/Storage/Plugin/ClearExpiredByFactor.php +++ b/src/Storage/Plugin/ClearExpiredByFactor.php @@ -8,7 +8,7 @@ use function random_int; -class ClearExpiredByFactor extends AbstractPlugin +final class ClearExpiredByFactor extends AbstractPlugin { /** * {@inheritDoc} diff --git a/src/Storage/Plugin/ExceptionHandler.php b/src/Storage/Plugin/ExceptionHandler.php index c0f0e542..839ee517 100644 --- a/src/Storage/Plugin/ExceptionHandler.php +++ b/src/Storage/Plugin/ExceptionHandler.php @@ -7,7 +7,7 @@ use function call_user_func; -class ExceptionHandler extends AbstractPlugin +final class ExceptionHandler extends AbstractPlugin { /** * {@inheritDoc} diff --git a/src/Storage/Plugin/IgnoreUserAbort.php b/src/Storage/Plugin/IgnoreUserAbort.php index c126302c..dc326320 100644 --- a/src/Storage/Plugin/IgnoreUserAbort.php +++ b/src/Storage/Plugin/IgnoreUserAbort.php @@ -9,7 +9,7 @@ use function connection_aborted; use function ignore_user_abort; -class IgnoreUserAbort extends AbstractPlugin +final class IgnoreUserAbort extends AbstractPlugin { /** * The storage who activated ignore_user_abort. diff --git a/src/Storage/Plugin/OptimizeByFactor.php b/src/Storage/Plugin/OptimizeByFactor.php index 7c4a369f..ea871117 100644 --- a/src/Storage/Plugin/OptimizeByFactor.php +++ b/src/Storage/Plugin/OptimizeByFactor.php @@ -8,7 +8,7 @@ use function random_int; -class OptimizeByFactor extends AbstractPlugin +final class OptimizeByFactor extends AbstractPlugin { /** * {@inheritDoc}