1 | <?php |
||
20 | class Injector |
||
21 | { |
||
22 | /** |
||
23 | * @var ContainerInterface |
||
24 | */ |
||
25 | private $container; |
||
26 | |||
27 | /** |
||
28 | * @var ParameterBagInterface |
||
29 | */ |
||
30 | private $parameter; |
||
31 | |||
32 | /** |
||
33 | * @var bool |
||
34 | */ |
||
35 | private $resolveUnknownClass = false; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @param ContainerInterface $container |
||
41 | */ |
||
42 | public function __construct(ContainerInterface $container) |
||
47 | |||
48 | /** |
||
49 | * Set resolve unknown class. |
||
50 | * |
||
51 | * @param bool $resolve |
||
52 | */ |
||
53 | public function resolveUnknownClass($resolve) |
||
57 | |||
58 | /** |
||
59 | * Resolve parameter arguments value. |
||
60 | * |
||
61 | * @param array $parameters |
||
62 | * |
||
63 | * @return array |
||
64 | */ |
||
65 | public function resolveParameters(array $parameters) |
||
74 | |||
75 | /** |
||
76 | * Replace parameters with arguments. |
||
77 | * |
||
78 | * @param array $serviceParameters |
||
79 | * @param array $parameters |
||
80 | * @param array $arguments |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function replaceArguments(array $serviceParameters, array $parameters, array $arguments) |
||
99 | |||
100 | /** |
||
101 | * Get parameter value. |
||
102 | * |
||
103 | * @param mixed $value |
||
104 | * |
||
105 | * @return array|mixed |
||
106 | */ |
||
107 | public function getParameterValue($value) |
||
124 | |||
125 | /** |
||
126 | * Compute parameter value. |
||
127 | * |
||
128 | * @param mixed $parameter |
||
129 | * |
||
130 | * @return array|mixed|null |
||
131 | */ |
||
132 | protected function computeParameterValue($parameter) |
||
147 | |||
148 | /** |
||
149 | * Compute parameter with class value. |
||
150 | * |
||
151 | * @param mixed $parameter |
||
152 | * |
||
153 | * @return mixed|object|null |
||
154 | */ |
||
155 | protected function computeParameterClass($parameter) |
||
172 | |||
173 | /** |
||
174 | * Get numeric arguments. |
||
175 | * |
||
176 | * @param array $parameters |
||
177 | * @param array $arguments |
||
178 | * |
||
179 | * @return array|null |
||
180 | */ |
||
181 | private function getNumericArguments(array $parameters, array $arguments) |
||
191 | |||
192 | /** |
||
193 | * Get parameter name. |
||
194 | * |
||
195 | * @param mixed $parameter |
||
196 | * |
||
197 | * @return mixed |
||
198 | */ |
||
199 | private function getParameterName($parameter) |
||
207 | |||
208 | /** |
||
209 | * Get parameter class. |
||
210 | * |
||
211 | * @param mixed $parameter |
||
212 | * |
||
213 | * @return mixed|null |
||
214 | */ |
||
215 | private function getParameterClass($parameter) |
||
223 | } |
||
224 |