Skip to content

Commit 2e4b740

Browse files
committed
Make deprecation messages more concise
1 parent 58f11ac commit 2e4b740

13 files changed

+12
-65
lines changed

components/dependency_injection.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,15 +303,11 @@ config files:
303303
;
304304
305305
$services->set('newsletter_manager', 'NewsletterManager')
306+
// In versions earlier to Symfony 5.1 the service() function was called ref()
306307
->call('setMailer', [service('mailer')])
307308
;
308309
};
309310
310-
.. deprecated:: 5.1
311-
312-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
313-
was deprecated in favor of the ``service()`` function.
314-
315311
Learn More
316312
----------
317313

security/custom_authentication_provider.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,13 @@ to service ids that may not exist yet: ``App\Security\Authentication\Provider\Ws
438438
439439
$services->set(WsseListener::class)
440440
->args([
441+
// In versions earlier to Symfony 5.1 the service() function was called ref()
441442
service('security.token_storage'),
442443
service('security.authentication.manager'),
443444
])
444445
;
445446
};
446447
447-
.. deprecated:: 5.1
448-
449-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
450-
was deprecated in favor of the ``service()`` function.
451-
452448
Now that your services are defined, tell your security context about your
453449
factory in the kernel::
454450

service_container.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,11 @@ parameter and in PHP config use the ``Reference`` class:
526526
$services = $configurator->services();
527527
528528
$services->set(MessageGenerator::class)
529+
// In versions earlier to Symfony 5.1 the service() function was called ref()
529530
->args([service('logger')])
530531
;
531532
};
532533
533-
.. deprecated:: 5.1
534-
535-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
536-
was deprecated in favor of the ``service()`` function.
537-
538534
Working with container parameters is straightforward using the container's
539535
accessor methods for parameters::
540536

service_container/alias_private.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,10 @@ The following example shows how to inject an anonymous service into another serv
267267
$services = $configurator->services();
268268
269269
$services->set(Foo::class)
270+
// In versions earlier to Symfony 5.1 the inline_service() function was called service()
270271
->args([inline_service(AnonymousBar::class)])
271272
};
272273
273-
.. versionadded:: 5.1
274-
275-
The ``inline_service()`` function was introduced in Symfony 5.1. In previous
276-
versions it was called ``inline()``.
277-
278274
.. note::
279275

280276
Anonymous services do *NOT* inherit the definitions provided from the

service_container/autowiring.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,6 @@ the injection::
511511
// ...
512512
};
513513
514-
.. deprecated:: 5.1
515-
516-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
517-
was deprecated in favor of the ``service()`` function.
518-
519514
Thanks to the ``App\Util\TransformerInterface`` alias, any argument type-hinted
520515
with this interface will be passed the ``App\Util\Rot13Transformer`` service.
521516
If the argument is named ``$shoutyTransformer``,

service_container/calls.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,10 @@ To configure the container to call the ``setLogger`` method, use the ``calls`` k
7272
// ...
7373
7474
$services->set(MessageGenerator::class)
75+
// In versions earlier to Symfony 5.1 the service() function was called ref()
7576
->call('setLogger', [service('logger')]);
7677
};
7778
78-
.. deprecated:: 5.1
79-
80-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
81-
was deprecated in favor of the ``service()`` function.
82-
8379
To provide immutable services, some classes implement immutable setters.
8480
Such setters return a new instance of the configured class
8581
instead of mutating the object they were called on::

service_container/configurators.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,14 @@ all the classes are already loaded as services. All you need to do is specify th
179179
$services->load('App\\', '../src/*');
180180
181181
// override the services to set the configurator
182+
// In versions earlier to Symfony 5.1 the service() function was called ref()
182183
$services->set(NewsletterManager::class)
183184
->configurator(service(EmailConfigurator::class), 'configure');
184185
185186
$services->set(GreetingCardManager::class)
186187
->configurator(service(EmailConfigurator::class), 'configure');
187188
};
188189
189-
.. deprecated:: 5.1
190-
191-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
192-
was deprecated in favor of the ``service()`` function.
193-
194190
.. _configurators-invokable:
195191

196192
Services can be configured via invokable configurators (replacing the

service_container/factories.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,10 @@ Configuration of the service container then looks like this:
158158
// second, use the factory service as the first argument of the 'factory'
159159
// method and the factory method as the second argument
160160
$services->set(NewsletterManager::class)
161+
// In versions earlier to Symfony 5.1 the service() function was called ref()
161162
->factory([service(NewsletterManagerFactory::class), 'createNewsletterManager']);
162163
};
163164
164-
.. deprecated:: 5.1
165-
166-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
167-
was deprecated in favor of the ``service()`` function.
168-
169165
.. _factories-invokable:
170166

171167
Invokable Factories

service_container/injection_types.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,10 @@ service container configuration:
7777
$services = $configurator->services();
7878
7979
$services->set(NewsletterManager::class)
80+
// In versions earlier to Symfony 5.1 the service() function was called ref()
8081
->args(service('mailer'));
8182
};
8283
83-
.. deprecated:: 5.1
84-
85-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
86-
was deprecated in favor of the ``service()`` function.
87-
8884
.. tip::
8985

9086
Type hinting the injected object means that you can be sure that a suitable

service_container/optional_dependencies.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,10 @@ if the service does not exist:
4242
$services = $configurator->services();
4343
4444
$services->set(NewsletterManager::class)
45+
// In versions earlier to Symfony 5.1 the service() function was called ref()
4546
->args([service('logger')->nullOnInvalid()]);
4647
};
4748
48-
.. deprecated:: 5.1
49-
50-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
51-
was deprecated in favor of the ``service()`` function.
52-
5349
.. note::
5450

5551
The "null" strategy is not currently supported by the YAML driver.

service_container/parent_services.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ duplicated service definitions:
129129
$services->set(BaseDoctrineRepository::class)
130130
->abstract()
131131
->args([service('doctrine.orm.entity_manager')])
132+
// In versions earlier to Symfony 5.1 the service() function was called ref()
132133
->call('setLogger', [service('logger')])
133134
;
134135
@@ -142,11 +143,6 @@ duplicated service definitions:
142143
;
143144
};
144145
145-
.. deprecated:: 5.1
146-
147-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
148-
was deprecated in favor of the ``service()`` function.
149-
150146
In this context, having a ``parent`` service implies that the arguments
151147
and method calls of the parent service should be used for the child services.
152148
Specifically, the ``EntityManager`` will be injected and ``setLogger()`` will

service_container/service_decoration.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ automatically changed to ``'.inner'``):
172172
$services->set(DecoratingMailer::class)
173173
->decorate(Mailer::class)
174174
// pass the old service as an argument
175+
// In versions earlier to Symfony 5.1 the service() function was called ref()
175176
->args([service('.inner')]);
176177
};
177178
@@ -180,11 +181,6 @@ automatically changed to ``'.inner'``):
180181
The special ``.inner`` value was introduced in Symfony 5.1. In previous
181182
versions you needed to use: ``decorating_service_id + '.inner'``.
182183

183-
.. deprecated:: 5.1
184-
185-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
186-
was deprecated in favor of the ``service()`` function.
187-
188184
.. tip::
189185

190186
The visibility of the decorated ``App\Mailer`` service (which is an alias

service_container/service_subscribers_locators.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ service definition to pass a collection of services to the service locator:
311311
$services = $configurator->services();
312312
313313
$services->set('app.command_handler_locator', ServiceLocator::class)
314+
// In versions earlier to Symfony 5.1 the service() function was called ref()
314315
->args([[
315316
'App\FooCommand' => service('app.command_handler.foo'),
316317
'App\BarCommand' => service('app.command_handler.bar'),
@@ -328,11 +329,6 @@ service definition to pass a collection of services to the service locator:
328329
;
329330
};
330331
331-
.. deprecated:: 5.1
332-
333-
In Symfony 5.1, the ``ref()`` function used in the PHP service configuration
334-
was deprecated in favor of the ``service()`` function.
335-
336332
.. note::
337333

338334
The services defined in the service locator argument must include keys,

0 commit comments

Comments
 (0)