diff --git a/src/Pattern/AbstractStorageCapablePattern.php b/src/Pattern/AbstractStorageCapablePattern.php index cb53c042..965de143 100644 --- a/src/Pattern/AbstractStorageCapablePattern.php +++ b/src/Pattern/AbstractStorageCapablePattern.php @@ -4,15 +4,22 @@ namespace Laminas\Cache\Pattern; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\StorageInterface; abstract class AbstractStorageCapablePattern extends AbstractPattern implements StorageCapableInterface { + /** + * @param StorageInterface $storage + */ public function __construct(protected StorageInterface $storage, ?PatternOptions $options = null) { parent::__construct($options); } + /** + * @return StorageInterface + */ public function getStorage(): StorageInterface { return $this->storage; diff --git a/src/Pattern/ObjectCache.php b/src/Pattern/ObjectCache.php index cbd12a28..5d540555 100644 --- a/src/Pattern/ObjectCache.php +++ b/src/Pattern/ObjectCache.php @@ -3,6 +3,7 @@ namespace Laminas\Cache\Pattern; use Laminas\Cache\Exception; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\StorageInterface; use Stringable; use Throwable; @@ -21,6 +22,9 @@ final class ObjectCache extends AbstractStorageCapablePattern implements Stringa { private CallbackCache $callbackCache; + /** + * @param StorageInterface $storage + */ public function __construct(StorageInterface $storage, ?PatternOptions $options = null) { parent::__construct($storage, $options); diff --git a/src/Psr/CacheItemPool/CacheItemPoolDecorator.php b/src/Psr/CacheItemPool/CacheItemPoolDecorator.php index 22641b9c..67bc2de1 100644 --- a/src/Psr/CacheItemPool/CacheItemPoolDecorator.php +++ b/src/Psr/CacheItemPool/CacheItemPoolDecorator.php @@ -7,6 +7,7 @@ use Laminas\Cache\Psr\Clock; use Laminas\Cache\Psr\MaximumKeyLengthTrait; use Laminas\Cache\Psr\SerializationTrait; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\ClearByNamespaceInterface; use Laminas\Cache\Storage\FlushableInterface; use Laminas\Cache\Storage\StorageInterface; @@ -292,6 +293,7 @@ public function commit(): bool /** * Throws exception is storage is not compatible with PSR-6 * + * @param StorageInterface $storage * @throws CacheException */ private function validateStorage(StorageInterface $storage): void diff --git a/src/Psr/MaximumKeyLengthTrait.php b/src/Psr/MaximumKeyLengthTrait.php index 6eaf9b78..b024c40f 100644 --- a/src/Psr/MaximumKeyLengthTrait.php +++ b/src/Psr/MaximumKeyLengthTrait.php @@ -5,6 +5,7 @@ namespace Laminas\Cache\Psr; use Laminas\Cache\Psr\SimpleCache\SimpleCacheInvalidArgumentException; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\Capabilities; use Laminas\Cache\Storage\StorageInterface; @@ -32,6 +33,9 @@ trait MaximumKeyLengthTrait /** @var int<0,max> */ private int $maximumKeyLength; + /** + * @param StorageInterface $storage + */ private function memoizeMaximumKeyLengthCapability(StorageInterface $storage, Capabilities $capabilities): void { $maximumKeyLength = $capabilities->maxKeyLength; diff --git a/src/Psr/SerializationTrait.php b/src/Psr/SerializationTrait.php index 150f4627..4858d244 100644 --- a/src/Psr/SerializationTrait.php +++ b/src/Psr/SerializationTrait.php @@ -2,6 +2,7 @@ namespace Laminas\Cache\Psr; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\StorageInterface; use function in_array; @@ -16,6 +17,8 @@ trait SerializationTrait { /** * Determine if the given storage adapter requires serialization. + * + * @param StorageInterface $storage */ private function isSerializationRequired(StorageInterface $storage): bool { diff --git a/src/Psr/SimpleCache/SimpleCacheDecorator.php b/src/Psr/SimpleCache/SimpleCacheDecorator.php index 27b6e5b1..997b25f8 100644 --- a/src/Psr/SimpleCache/SimpleCacheDecorator.php +++ b/src/Psr/SimpleCache/SimpleCacheDecorator.php @@ -8,6 +8,7 @@ use Laminas\Cache\Psr\Clock; use Laminas\Cache\Psr\MaximumKeyLengthTrait; use Laminas\Cache\Psr\SerializationTrait; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\Capabilities; use Laminas\Cache\Storage\ClearByNamespaceInterface; use Laminas\Cache\Storage\FlushableInterface; @@ -54,6 +55,9 @@ final class SimpleCacheDecorator implements SimpleCacheInterface private ClockInterface $clock; + /** + * @param StorageInterface $storage + */ public function __construct( private readonly StorageInterface $storage, ?ClockInterface $clock = null, diff --git a/src/Storage/Adapter/AdapterOptions.php b/src/Storage/Adapter/AdapterOptions.php index bae9a1df..b6b44db1 100644 --- a/src/Storage/Adapter/AdapterOptions.php +++ b/src/Storage/Adapter/AdapterOptions.php @@ -46,6 +46,8 @@ class AdapterOptions extends AbstractOptions /** * The adapter using these options + * + * @var StorageInterface */ protected ?StorageInterface $adapter = null; @@ -78,6 +80,8 @@ class AdapterOptions extends AbstractOptions /** * Adapter using this instance + * + * @param StorageInterface $adapter */ public function setAdapter(?StorageInterface $adapter = null): self { diff --git a/src/Storage/Adapter/KeyListIterator.php b/src/Storage/Adapter/KeyListIterator.php index 6ec8a474..4ebe9d8c 100644 --- a/src/Storage/Adapter/KeyListIterator.php +++ b/src/Storage/Adapter/KeyListIterator.php @@ -32,6 +32,7 @@ final class KeyListIterator implements IteratorInterface, Countable protected int $position = 0; /** + * @param StorageInterface $storage * @param array $keys Keys to iterate over */ public function __construct( @@ -42,7 +43,7 @@ public function __construct( } /** - * Get storage instance + * @return StorageInterface */ public function getStorage(): StorageInterface { diff --git a/src/Storage/Event.php b/src/Storage/Event.php index cb8022a0..603b6999 100644 --- a/src/Storage/Event.php +++ b/src/Storage/Event.php @@ -3,6 +3,7 @@ namespace Laminas\Cache\Storage; use ArrayObject; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\EventManager\Event as BaseEvent; /** @extends BaseEvent */ @@ -12,6 +13,7 @@ class Event extends BaseEvent * Accept a storage adapter and its parameters. * * @param non-empty-string $name Event name + * @param StorageInterface $storage * @param ArrayObject $params */ public function __construct(string $name, StorageInterface $storage, ArrayObject $params) @@ -24,7 +26,7 @@ public function __construct(string $name, StorageInterface $storage, ArrayObject * * @see \Laminas\EventManager\Event::setTarget() * - * @param StorageInterface $target + * @param StorageInterface $target */ public function setTarget($target): void { @@ -36,6 +38,8 @@ public function setTarget($target): void * Alias of setTarget * * @see \Laminas\EventManager\Event::setTarget() + * + * @param StorageInterface $storage */ public function setStorage(StorageInterface $storage): self { @@ -45,6 +49,8 @@ public function setStorage(StorageInterface $storage): self /** * Alias of getTarget + * + * @return StorageInterface */ public function getStorage(): StorageInterface { diff --git a/src/Storage/ExceptionEvent.php b/src/Storage/ExceptionEvent.php index 9794d191..f51fa597 100644 --- a/src/Storage/ExceptionEvent.php +++ b/src/Storage/ExceptionEvent.php @@ -3,6 +3,7 @@ namespace Laminas\Cache\Storage; use ArrayObject; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Throwable; class ExceptionEvent extends PostEvent @@ -21,6 +22,7 @@ class ExceptionEvent extends PostEvent * Accept a target and its parameters. * * @param non-empty-string $name Event name + * @param StorageInterface $storage * @param ArrayObject $params */ public function __construct( diff --git a/src/Storage/Plugin/IgnoreUserAbort.php b/src/Storage/Plugin/IgnoreUserAbort.php index dc326320..a4f87689 100644 --- a/src/Storage/Plugin/IgnoreUserAbort.php +++ b/src/Storage/Plugin/IgnoreUserAbort.php @@ -2,6 +2,7 @@ namespace Laminas\Cache\Storage\Plugin; +use Laminas\Cache\Storage\Adapter\AdapterOptions; use Laminas\Cache\Storage\Event; use Laminas\Cache\Storage\StorageInterface; use Laminas\EventManager\EventManagerInterface; @@ -13,6 +14,8 @@ final class IgnoreUserAbort extends AbstractPlugin { /** * The storage who activated ignore_user_abort. + * + * @var StorageInterface */ protected ?StorageInterface $activatedTarget = null; diff --git a/src/Storage/PostEvent.php b/src/Storage/PostEvent.php index 4e148997..d2822f39 100644 --- a/src/Storage/PostEvent.php +++ b/src/Storage/PostEvent.php @@ -3,6 +3,7 @@ namespace Laminas\Cache\Storage; use ArrayObject; +use Laminas\Cache\Storage\Adapter\AdapterOptions; class PostEvent extends Event { @@ -15,6 +16,7 @@ class PostEvent extends Event * Accept a target and its parameters. * * @param non-empty-string $name Event name + * @param StorageInterface $storage * @param ArrayObject $params */ public function __construct(string $name, StorageInterface $storage, ArrayObject $params, mixed $result)