Permalink
Browse files

Resolver::normalizeEntity() checks whether Definition is in container…

… builder [Closes #184]
  • Loading branch information...
dg committed Nov 30, 2018
1 parent 9de80d0 commit ec380f1ad92de458993d5073e0ba935edad63198
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/DI/Resolver.php
@@ -305,7 +305,11 @@ private function normalizeEntity(Statement $statement)
}
if ($item instanceof Definition) {
$item = new Reference(current(array_keys($this->builder->getDefinitions(), $item, true)));
$name = current(array_keys($this->builder->getDefinitions(), $item, true));
if ($name == false) {
throw new ServiceCreationException("Service '{$item->getName()}' not found in definitions.");
}
$item = new Reference((string) $name);
}
if ($item instanceof Reference) {
$item = $this->normalizeReference($item);

0 comments on commit ec380f1

Please sign in to comment.