We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5dbd49 commit 27ca372Copy full SHA for 27ca372
components/dependency_injection/factories.rst
@@ -68,6 +68,13 @@ class:
68
69
$container->setDefinition('newsletter_manager', $definition);
70
71
+.. note::
72
+
73
+ When creating a service through a factory, the value chosen for the ``class``
74
+ option has no actual effect since the final class only depends on the object
75
+ returned by the factory. However, the configured class may be used by compiler
76
+ passes and therefore should be set to a sensible value.
77
78
When you specify the class to use for the factory (via ``factory_class``)
79
the method will be called statically. If the factory itself should be instantiated
80
and the resulting object's method called, configure the factory itself as a service.
0 commit comments