1 | <?php declare(strict_types=1); |
||
12 | class ReflectionContainer implements ArgumentResolverInterface, ContainerInterface |
||
13 | { |
||
14 | use ArgumentResolverTrait; |
||
15 | use ContainerAwareTrait; |
||
16 | |||
17 | /** |
||
18 | * @var boolean |
||
19 | */ |
||
20 | protected $cacheResolutions = false; |
||
21 | |||
22 | /** |
||
23 | * Cache of reslutions. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $cache = []; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 36 | public function get($id, array $args = []) |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 42 | public function has($id) : bool |
|
66 | |||
67 | /** |
||
68 | * Invoke a callable via the container. |
||
69 | * |
||
70 | * @param callable $callable |
||
71 | * @param array $args |
||
72 | * |
||
73 | * @return mixed |
||
74 | */ |
||
75 | 15 | public function call(callable $callable, array $args = []) |
|
105 | |||
106 | /** |
||
107 | * Whether the container should default to caching resolutions and returning |
||
108 | * the cache on following calls. |
||
109 | * |
||
110 | * @param boolean $option |
||
111 | * |
||
112 | * @return self |
||
113 | */ |
||
114 | 6 | public function cacheResolutions(bool $option = true) : ContainerInterface |
|
120 | } |
||
121 |