Skip to content

Commit

Permalink
Fixed generated factories
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Sep 6, 2014
1 parent c7d046e commit 604d4f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/DI/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ private function resolveImplement(ServiceDefinition $def, $name)

if (!$def->parameters) {
$ctorParams = array();
if ((!$def->factory || (!$def->factory->entity && !$def->factory->arguments)) && $def->class) {
$def->setFactory($def->class);
}
if ($def->factory && !$def->factory->arguments && ($class = $this->resolveEntityClass($def->factory, array($name => 1)))
&& ($ctor = Reflection\ClassType::from($class)->getConstructor())
) {
Expand Down

0 comments on commit 604d4f3

Please sign in to comment.