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