1 | <?php |
||
16 | class Registry implements ContainerInterface |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var ContainerInterface |
||
21 | */ |
||
22 | private $container; |
||
23 | |||
24 | /** |
||
25 | * @var AbstractObjectType[] |
||
26 | */ |
||
27 | private $values = []; |
||
28 | /** |
||
29 | * @var null|AuthorizationServiceInterface |
||
30 | */ |
||
31 | private $authorizationService; |
||
32 | |||
33 | /** |
||
34 | * @param ContainerInterface $container The proxied container. |
||
35 | * @param AuthorizationServiceInterface|null $authorizationService |
||
36 | */ |
||
37 | public function __construct(ContainerInterface $container, AuthorizationServiceInterface $authorizationService = null) |
||
42 | |||
43 | /** |
||
44 | * Finds an entry of the container by its identifier and returns it. |
||
45 | * |
||
46 | * @param string $id Identifier of the entry to look for. |
||
47 | * |
||
48 | * @throws NotFoundExceptionInterface No entry was found for **this** identifier. |
||
49 | * @throws ContainerExceptionInterface Error while retrieving the entry. |
||
50 | * |
||
51 | * @return mixed Entry. |
||
52 | */ |
||
53 | public function get($id) |
||
69 | |||
70 | /** |
||
71 | * Returns true if the container can return an entry for the given identifier. |
||
72 | * Returns false otherwise. |
||
73 | * |
||
74 | * `has($id)` returning true does not mean that `get($id)` will not throw an exception. |
||
75 | * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. |
||
76 | * |
||
77 | * @param string $id Identifier of the entry to look for. |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function has($id) |
||
96 | |||
97 | /** |
||
98 | * Returns the authorization service. |
||
99 | * |
||
100 | * @return AuthorizationServiceInterface|null |
||
101 | */ |
||
102 | public function getAuthorizationService(): ?AuthorizationServiceInterface |
||
106 | } |
||
107 |