8000 [DX][Cache] Set right type hint for cacheItem on AdapterInterface get… · symfony/symfony@5f7baa5 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 5f7baa5

Browse files
committed
[DX][Cache] Set right type hint for cacheItem on AdapterInterface getters
| Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Fixes missing type hint for cache item on pool getters so methods on Symfony CacheItem is correclty suggested when using IDE's or api documentation. As proposed here: #19728 (comment) Note: Specifically sets array of items as return type of getItems as phpdoc and IDEs supports this by now, and since this is specifically what is being returned.
1 parent cbb5332 commit 5f7baa5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Symfony/Component/Cache/Adapter/AdapterInterface.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,17 @@
2121
*/
2222
interface AdapterInterface extends CacheItemPoolInterface
2323
{
24+
/**
25+
* {@inheritdoc}
26+
*
27+
* @return \Symfony\Component\Cache\CacheItem
28+
*/
29+
public function getItem($key);
30+
31+
/**
32+
* {@inheritdoc}
33+
*
34+
* return \Symfony\Component\Cache\CacheItem[]
35+
*/
36+
public function getItems(array $keys = []);
2437
}

0 commit comments

Comments
 (0)
0