1 | <?php |
||
9 | class InjectorContainer implements ContainerInterface |
||
10 | { |
||
11 | const I_ALL = 31; |
||
12 | |||
13 | /** |
||
14 | * @var Injector |
||
15 | */ |
||
16 | private $injector; |
||
17 | |||
18 | 7 | public function __construct(Injector $injector) |
|
22 | |||
23 | // ContainerInterface |
||
24 | 4 | public function get($id) |
|
36 | |||
37 | // ContainerInterface |
||
38 | 5 | public function has($id) |
|
39 | { |
||
40 | 5 | return class_exists($id) || $this->hasReference($id); |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * Check the injector has a reference |
||
45 | * |
||
46 | * @param string $id |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | 3 | private function hasReference($id) |
|
56 | } |
||
57 |