1 | <?php |
||
19 | final class Container |
||
20 | { |
||
21 | /** @var DependencyInterface[] */ |
||
22 | private $container = []; |
||
23 | |||
24 | /** @var array<int, Pointcut> */ |
||
25 | private $pointcuts = []; |
||
26 | |||
27 | /** |
||
28 | * @return list<string> |
||
|
|||
29 | */ |
||
30 | public function __sleep() |
||
34 | |||
35 | /** |
||
36 | * Add binding to container |
||
37 | */ |
||
38 | public function add(Bind $bind): void |
||
43 | |||
44 | /** |
||
45 | * Add Pointcut to container |
||
46 | */ |
||
47 | public function addPointcut(Pointcut $pointcut): void |
||
51 | |||
52 | /** |
||
53 | * Return instance by interface + name(interface namespace) |
||
54 | * |
||
55 | * @param class-string|string $interface |
||
56 | * |
||
57 | * @return mixed |
||
58 | */ |
||
59 | public function getInstance(string $interface, string $name) |
||
63 | |||
64 | /** |
||
65 | * Return dependency injected instance |
||
66 | * |
||
67 | * @param array<int, mixed> $params |
||
68 | * |
||
69 | * @return mixed |
||
70 | * |
||
71 | * @throws Unbound |
||
72 | */ |
||
73 | public function getInstanceWithArgs(string $interface, array $params) |
||
87 | |||
88 | /** |
||
89 | * Return dependency injected instance |
||
90 | * |
||
91 | * @return mixed |
||
92 | * |
||
93 | * @throws Unbound |
||
94 | */ |
||
95 | public function getDependency(string $index) |
||
105 | |||
106 | /** |
||
107 | * Rename existing dependency interface + name |
||
108 | */ |
||
109 | public function move(string $sourceInterface, string $sourceName, string $targetInterface, string $targetName): void |
||
120 | |||
121 | /** |
||
122 | * Return Unbound exception |
||
123 | * |
||
124 | * @param string $index {interface}-{bind name} |
||
125 | * |
||
126 | * @return Unbound|Untargeted |
||
127 | */ |
||
128 | public function unbound(string $index) |
||
137 | |||
138 | /** |
||
139 | * Return container |
||
140 | * |
||
141 | * @return DependencyInterface[] |
||
142 | */ |
||
143 | public function getContainer(): array |
||
147 | |||
148 | /** |
||
149 | * Return pointcuts |
||
150 | * |
||
151 | * @return array<int, Pointcut> |
||
152 | */ |
||
153 | public function getPointcuts(): array |
||
157 | |||
158 | /** |
||
159 | * Merge container |
||
160 | */ |
||
161 | public function merge(self $container): void |
||
166 | |||
167 | /** |
||
168 | * Weave aspects to all dependency in container |
||
169 | */ |
||
170 | public function weaveAspects(CompilerInterface $compiler): void |
||
178 | |||
179 | /** |
||
180 | * Weave aspect to single dependency |
||
181 | */ |
||
182 | public function weaveAspect(Compiler $compiler, Dependency $dependency): self |
||
188 | |||
189 | /** |
||
190 | * @param callable(DependencyInterface): DependencyInterface $f |
||
191 | */ |
||
192 | public function map(callable $f): void |
||
198 | } |
||
199 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.