|
@@ 201-212 (lines=12) @@
|
| 198 |
|
*/ |
| 199 |
|
|
| 200 |
|
foreach ($metadataCollection as $alias => $metadata) { |
| 201 |
|
foreach ($metadata->propertiesMetadata as $property => $propertyMetadata) { |
| 202 |
|
if (is_string($propertyMetadata->dependency)) { |
| 203 |
|
$dependency = $propertyMetadata->dependency; |
| 204 |
|
if (array_key_exists($dependency, $implementsByAlias)) { |
| 205 |
|
$propertyMetadata->dependency = $implementsByAlias[$dependency][0]; |
| 206 |
|
} elseif (array_key_exists($dependency, $serviceAliasesByClass)) { |
| 207 |
|
$propertyMetadata->dependency = $serviceAliasesByClass[$dependency][0]; |
| 208 |
|
} else { |
| 209 |
|
|
| 210 |
|
} |
| 211 |
|
} |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
// Iterate constructor arguments to preserve arguments order and inject dependencies |
| 215 |
|
$reflectionClass = new \ReflectionClass($metadata->className); |
|
@@ 230-242 (lines=13) @@
|
| 227 |
|
} |
| 228 |
|
|
| 229 |
|
foreach ($metadata->methodsMetadata as $method => $methodMetadata) { |
| 230 |
|
foreach ($methodMetadata->dependencies as $argument => $dependency) { |
| 231 |
|
if (is_string($dependency)) { |
| 232 |
|
if (array_key_exists($dependency, $implementsByAlias)) { |
| 233 |
|
$methodMetadata->dependencies[$argument] = $implementsByAlias[$dependency][0]; |
| 234 |
|
//$methodMetadata->parametersMetadata[$argument]->dependency = $implementsByAlias[$dependency][0]; |
| 235 |
|
} elseif (array_key_exists($dependency, $serviceAliasesByClass)) { |
| 236 |
|
$methodMetadata->dependencies[$argument] = $serviceAliasesByClass[$dependency][0]; |
| 237 |
|
//$methodMetadata->parametersMetadata[$argument]->dependency = $serviceAliasesByClass[$dependency][0]; |
| 238 |
|
} else { |
| 239 |
|
|
| 240 |
|
} |
| 241 |
|
} |
| 242 |
|
} |
| 243 |
|
} |
| 244 |
|
} |
| 245 |
|
} |