Skip to content

Commit f043881

Browse files
committed
Merge branch '4.2' into 4.3
* 4.2: Remove short factories/configurators examples
2 parents 2f91fe2 + f8b867f commit f043881

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed

doctrine/pdo_session_storage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To use it, first register a new handler service:
2828
2929
# If you're using Doctrine & want to re-use that connection, then:
3030
# comment-out the above 2 lines and uncomment the line below
31-
# - !service { class: PDO, factory: 'database_connection:getWrappedConnection' }
31+
# - !service { class: PDO, factory: ['@database_connection', 'getWrappedConnection'] }
3232
# If you get transaction issues (e.g. after login) uncomment the line below
3333
# - { lock_mode: 1 }
3434

service_container/configurators.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ all the classes are already loaded as services. All you need to do is specify th
136136
137137
# override the services to set the configurator
138138
App\Mail\NewsletterManager:
139-
configurator: 'App\Mail\EmailConfigurator:configure'
139+
configurator: ['@App\Mail\EmailConfigurator', 'configure']
140140
141141
App\Mail\GreetingCardManager:
142-
configurator: 'App\Mail\EmailConfigurator:configure'
142+
configurator: ['@App\Mail\EmailConfigurator', 'configure']
143143
144144
.. code-block:: xml
145145
@@ -184,17 +184,6 @@ all the classes are already loaded as services. All you need to do is specify th
184184
$container->getDefinition(GreetingCardManager::class)
185185
->setConfigurator([new Reference(EmailConfigurator::class), 'configure']);
186186
187-
The traditional configurator syntax in YAML files used an array to define
188-
the service id and the method name:
189-
190-
.. code-block:: yaml
191-
192-
app.newsletter_manager:
193-
# new syntax
194-
configurator: 'App\Mail\EmailConfigurator:configure'
195-
# old syntax
196-
configurator: ['@App\Mail\EmailConfigurator', configure]
197-
198187
.. _configurators-invokable:
199188

200189
.. versionadded:: 4.3

service_container/factories.rst

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configure the service container to use the
4141
4242
App\Email\NewsletterManager:
4343
# call the static method
44-
factory: ['App\Email\NewsletterManagerStaticFactory', createNewsletterManager]
44+
factory: ['App\Email\NewsletterManagerStaticFactory', 'createNewsletterManager']
4545
4646
.. code-block:: xml
4747
@@ -104,7 +104,7 @@ Configuration of the service container then looks like this:
104104
105105
App\Email\NewsletterManager:
106106
# call a method on the specified factory service
107-
factory: 'App\Email\NewsletterManagerFactory:createNewsletterManager'
107+
factory: ['@App\Email\NewsletterManagerFactory', 'createNewsletterManager']
108108
109109
.. code-block:: xml
110110
@@ -144,20 +144,6 @@ Configuration of the service container then looks like this:
144144
'createNewsletterManager',
145145
]);
146146
147-
.. note::
148-
149-
The traditional configuration syntax in YAML files used an array to define
150-
the factory service and the method name:
151-
152-
.. code-block:: yaml
153-
154-
# config/services.yaml
155-
App\Email\NewsletterManager:
156-
# new syntax
157-
factory: 'App\Email\NewsletterManagerFactory:createNewsletterManager'
158-
# old syntax
159-
factory: ['@App\Email\NewsletterManagerFactory', createNewsletterManager]
160-
161147
.. _factories-invokable:
162148

163149
Suppose you now change your factory method to ``__invoke()`` so that your
@@ -248,7 +234,7 @@ example takes the ``templating`` service as an argument:
248234
# ...
249235
250236
App\Email\NewsletterManager:
251-
factory: 'App\Email\NewsletterManagerFactory:createNewsletterManager'
237+
factory: ['@App\Email\NewsletterManagerFactory', createNewsletterManager]
252238
arguments: ['@templating']
253239
254240
.. code-block:: xml

0 commit comments

Comments
 (0)