Skip to content

Commit a20ea5d

Browse files
committed
Merge branch '2.7' into 2.8
2 parents 0281f61 + 5135e4c commit a20ea5d

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

Diff for: components/dependency_injection/factories.rst

-19
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,8 @@ object::
3333
}
3434

3535
To make the ``NewsletterManager`` object available as a service, you can
36-
<<<<<<< HEAD
3736
configure the service container to use the
3837
``NewsletterFactory::createNewsletterManager()`` factory method:
39-
=======
40-
configure the service container to use the ``NewsletterManagerFactory``
41-
factory class:
42-
>>>>>>> 2.3
4338

4439
.. configuration-block::
4540

@@ -82,18 +77,10 @@ factory class:
8277
the configured class name may be used by compiler passes and therefore
8378
should be set to a sensible value.
8479

85-
<<<<<<< HEAD
8680
Now, the method will be called statically. If the factory class itself should
8781
be instantiated and the resulting object's method called, configure the factory
8882
itself as a service. In this case, the method (e.g. get) should be changed to
8983
be non-static.
90-
=======
91-
When you specify the class to use for the factory (via ``factory_class``)
92-
the method will be called statically. If the factory itself should be instantiated
93-
and the resulting object's method called, configure the factory itself
94-
as a service. In this case, the method (e.g. ``createNewsletterManager``)
95-
should be changed to be non-static:
96-
>>>>>>> 2.3
9784

9885
.. configuration-block::
9986

@@ -130,18 +117,12 @@ should be changed to be non-static:
130117
// ...
131118
$container->register('newsletter_manager.factory', 'NewsletterManagerFactory');
132119
133-
<<<<<<< HEAD
134120
$newsletterManager = new Definition();
135121
$newsletterManager->setFactory(array(
136122
new Reference('newsletter_manager.factory'),
137123
'createNewsletterManager'
138124
));
139125
$container->setDefinition('newsletter_manager', $newsletterManager);
140-
=======
141-
The factory service is specified by its id name and not a reference
142-
to the service itself. So, you do not need to use the ``@`` syntax for
143-
this in YAML configurations.
144-
>>>>>>> 2.3
145126
146127
Passing Arguments to the Factory Method
147128
---------------------------------------

0 commit comments

Comments
 (0)