Skip to content

Commit 4d247b0

Browse files
minor symfony#21277 [DX][Cache] Set right cacheItem type hint on AdapterInterface getters (andrerom)
This PR was merged into the 3.1 branch. Discussion ---------- [DX][Cache] Set right cacheItem type hint 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 cache item type hint on pool getters so methods on Symfony CacheItem is correctly suggested when using IDE's or api documentation. As proposed here: symfony#19728 (comment) _Note: Specifically sets array of CacheItems as return type of getItems as phpdoc and IDEs supports this by now, and since this is specifically what is being returned. If Sami does not still support this we can adjust to what was originally suggested._ Commits ------- 5f7baa5 [DX][Cache] Set right type hint for cacheItem on AdapterInterface getters
2 parents cbb5332 + 5f7baa5 commit 4d247b0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,23 @@
1515
use Symfony\Component\Cache\CacheItem;
1616

1717
/**
18-
* Interface for adapters managing instances of Symfony's {@see CacheItem}.
18+
* Interface for adapters managing instances of Symfony's CacheItem.
1919
*
2020
* @author Kévin Dunglas <[email protected]>
2121
*/
2222
interface AdapterInterface extends CacheItemPoolInterface
2323
{
24+
/**
25+
* {@inheritdoc}
26+
*
27+
* @return CacheItem
28+
*/
29+
public function getItem($key);
30+
31+
/**
32+
* {@inheritdoc}
33+
*
34+
* return \Traversable|CacheItem[]
35+
*/
36+
public function getItems(array $keys = array());
2437
}

0 commit comments

Comments
 (0)