1 | <?php |
||
14 | final class PimpleAdapter implements ContainerInterface |
||
15 | { |
||
16 | const FACTORY_CONTEXT_POSTFIX = '.context'; |
||
17 | |||
18 | /** @var Container */ |
||
19 | private $container; |
||
20 | |||
21 | 26 | public function __construct(Container $container) |
|
25 | |||
26 | 6 | public function addArgument(string $parameter, $argument) |
|
30 | |||
31 | 8 | public function hasArgument(string $parameter): bool |
|
35 | |||
36 | /** |
||
37 | * @throws ArgumentNotFoundException |
||
38 | * |
||
39 | * @return mixed |
||
40 | */ |
||
41 | 5 | public function getArgument(string $parameter) |
|
49 | |||
50 | 3 | public function addFactoryContext(string $factoryClass, array $context) |
|
54 | |||
55 | 4 | public function hasFactoryContext(string $factoryClass): bool |
|
59 | |||
60 | 2 | public function getFactoryContext(string $factoryClass): array |
|
68 | |||
69 | 8 | public function addInstance($instance) |
|
77 | |||
78 | 2 | public function addInstanceLazyLoad(BuilderInterface $builder, string $class, array $arguments = []) |
|
86 | |||
87 | /** |
||
88 | * @throws ClassOrInterfaceNotFoundException |
||
89 | */ |
||
90 | 11 | public function hasInstance(string $class): bool |
|
96 | |||
97 | /** |
||
98 | * @throws InstanceNotFoundException |
||
99 | * @throws ClassOrInterfaceNotFoundException |
||
100 | * |
||
101 | * @return mixed |
||
102 | */ |
||
103 | 8 | public function getInstance(string $class) |
|
111 | |||
112 | /** |
||
113 | * @return mixed |
||
114 | */ |
||
115 | 9 | private function addKey(string $key, $content) |
|
119 | |||
120 | 18 | private function hasKey(string $key): bool |
|
124 | |||
125 | /** |
||
126 | * @return mixed |
||
127 | */ |
||
128 | 9 | private function getKey(string $key) |
|
132 | |||
133 | 5 | private function generateFactoryContextKey(string $factoryClass): string |
|
137 | |||
138 | /** |
||
139 | * @throws ClassOrInterfaceNotFoundException |
||
140 | */ |
||
141 | 12 | private function assertClassOrInterfaceExists(string $class) |
|
147 | } |
||
148 |