1 | <?php |
||
24 | class AnnotationCache |
||
25 | { |
||
26 | /** @var CacheInterface */ |
||
27 | private $cache; |
||
28 | |||
29 | /** @var array */ |
||
30 | private $data; |
||
31 | |||
32 | /** |
||
33 | * @param CacheInterface|null $cache |
||
34 | */ |
||
35 | public function __construct(CacheInterface $cache = null) |
||
39 | |||
40 | /** |
||
41 | * @param $key |
||
42 | * @return mixed|null |
||
43 | * @throws InvalidArgumentException |
||
44 | */ |
||
45 | public function get($key) |
||
49 | |||
50 | /** |
||
51 | * @param $key |
||
52 | * @param $data |
||
53 | * @throws InvalidArgumentException |
||
54 | */ |
||
55 | public function set($key, $data) |
||
63 | |||
64 | /** |
||
65 | * @param string $key |
||
66 | * @param \Closure $closure |
||
67 | * @return mixed|null |
||
68 | * @throws InvalidArgumentException |
||
69 | */ |
||
70 | public function fetch(string $key, \Closure $closure) |
||
79 | } |