| 1 | <?php |
||
| 24 | class CachePlugin implements Plugin |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var CacheInterface |
||
| 28 | */ |
||
| 29 | private $cache; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * How log a result is going to be cached. |
||
| 33 | * |
||
| 34 | * @var int|null |
||
| 35 | */ |
||
| 36 | private $lifetime; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param CacheInterface $cache |
||
| 40 | * @param int $lifetime |
||
|
|
|||
| 41 | */ |
||
| 42 | public function __construct(CacheInterface $cache, int $lifetime = null) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function handleQuery(Query $query, callable $next, callable $first) |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @param Query $query |
||
| 66 | * |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | private function getCacheKey(Query $query): string |
||
| 74 | } |
||
| 75 |
This check looks for
@paramannotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.