Skip to content

Commit

Permalink
[DI] dont mandate a class on inline services with a factory
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Oct 1, 2019
1 parent 2b71c6f commit 124ea65
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function process(ContainerBuilder $container)
}

// non-synthetic, non-abstract service has class
if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) {
if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass() && (!$definition->getFactory() || '.' !== substr($id, 0, 1))) {
if ($definition->getFactory()) {
throw new RuntimeException(sprintf('Please add the class to service "%s" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $id));
}
Expand Down

0 comments on commit 124ea65

Please sign in to comment.