Skip to content

Commit 2cd2b28

Browse files
committed
bugfix: add missing template param for StorageInterface
Signed-off-by: Maximilian Bösing <[email protected]>
1 parent 512dc92 commit 2cd2b28

6 files changed

+29
-3
lines changed

src/Storage/Adapter/AbstractAdapter.php

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
/**
3333
* @template TOptions of AdapterOptions
34+
* @template-implements StorageInterface<TOptions>
3435
*/
3536
abstract class AbstractAdapter implements StorageInterface, PluginAwareInterface
3637
{

src/Storage/StorageInterface.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33
namespace Laminas\Cache\Storage;
44

55
use Laminas\Cache\Exception\ExceptionInterface;
6+
use Laminas\Cache\Storage\Adapter\AdapterOptions;
67

78
/**
8-
* NOTE: when providing integrish cache keys in iterables, internal array conversion might convert these to int, even
9+
* NOTE: when providing integerish cache keys in iterables, internal array conversion might convert these to int, even
910
* tho they were non-empty-string beforehand. See https://3v4l.org/GsiBl for more details.
1011
*
1112
* @psalm-type CacheKeyInIterableType = non-empty-string|int
13+
* @template TOptions of AdapterOptions
1214
*/
1315
interface StorageInterface
1416
{
15-
public function setOptions(iterable|Adapter\AdapterOptions $options): self;
17+
public function setOptions(iterable|AdapterOptions $options): self;
1618

17-
public function getOptions(): Adapter\AdapterOptions;
19+
/**
20+
* @return TOptions
21+
*/
22+
public function getOptions(): AdapterOptions;
1823

1924
/* reading */
2025
/**

test/Psr/CacheItemPool/TestAsset/FlushableStorageAdapterInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44

55
namespace LaminasTest\Cache\Psr\CacheItemPool\TestAsset;
66

7+
use Laminas\Cache\Storage\Adapter\AdapterOptions;
78
use Laminas\Cache\Storage\FlushableInterface;
89
use Laminas\Cache\Storage\StorageInterface;
910

11+
/**
12+
* @template TOptions of AdapterOptions
13+
* @template-extends StorageInterface<TOptions>
14+
*/
1015
interface FlushableStorageAdapterInterface extends StorageInterface, FlushableInterface
1116
{
1217
}

test/Psr/TestAsset/FlushableNamespaceStorageInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44

55
namespace LaminasTest\Cache\Psr\TestAsset;
66

7+
use Laminas\Cache\Storage\Adapter\AdapterOptions;
78
use Laminas\Cache\Storage\ClearByNamespaceInterface;
89

10+
/**
11+
* @template TOptions of AdapterOptions
12+
* @template-extends FlushableStorageInterface<TOptions>
13+
*/
914
interface FlushableNamespaceStorageInterface extends FlushableStorageInterface, ClearByNamespaceInterface
1015
{
1116
}

test/Psr/TestAsset/FlushableStorageInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
namespace LaminasTest\Cache\Psr\TestAsset;
66

7+
use Laminas\Cache\Storage\Adapter\AdapterOptions;
78
use Laminas\Cache\Storage\FlushableInterface;
89
use Laminas\Cache\Storage\PluginAwareInterface;
910
use Laminas\Cache\Storage\StorageInterface;
1011

12+
/**
13+
* @template TOptions of AdapterOptions
14+
* @template-extends StorageInterface<TOptions>
15+
*/
1116
interface FlushableStorageInterface extends StorageInterface, FlushableInterface, PluginAwareInterface
1217
{
1318
}

test/Storage/Adapter/TestAsset/AdapterWithStorageAndEventsCapableInterface.php

+5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
namespace LaminasTest\Cache\Storage\Adapter\TestAsset;
66

7+
use Laminas\Cache\Storage\Adapter\AdapterOptions;
78
use Laminas\Cache\Storage\Plugin\PluginInterface;
89
use Laminas\Cache\Storage\StorageInterface;
910
use Laminas\EventManager\EventsCapableInterface;
1011

12+
/**
13+
* @template TOptions of AdapterOptions
14+
* @template-extends StorageInterface<TOptions>
15+
*/
1116
interface AdapterWithStorageAndEventsCapableInterface extends StorageInterface, EventsCapableInterface
1217
{
1318
public function hasPlugin(PluginInterface $plugin): bool;

0 commit comments

Comments
 (0)