When we can not create the class, try if the variable is a registered service

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-10-05 16:32:23 +02:00
parent 92b564a3b9
commit 8b3deb00b3
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ class SimpleContainer extends Container implements IContainer {
// Service not found, use the default value when available
if ($parameter->isDefaultValueAvailable()) {
$parameters[] = $parameter->getDefaultValue();
} else if ($parameterClass !== null) {
$resolveName = $parameter->getName();
$parameters[] = $this->query($resolveName);
} else {
throw $e;
}