Skip to content

Commit 9357aba

Browse files
committed
minor symfony#14682 [DependencyInjection] [Service Container] Fix Service parameters typo in services.yml (Yondz)
This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] [Service Container] Fix Service parameters typo in services.yml Hi there, I noticed a strange yml in the service_container doc, affecting >= 4.3 , there was a misplaced parameter under an example service definition. I thought it would be nice to keep the actual information about escaping using `@` so I just removed the wrong `mailer_password: '@@securepassword'` thing. I used 4.4 as target, maybe this could be merged to 4.3 as well, I'll let you check this point ! =) Commits ------- a741c9c [Service Container] Fix Service parameters typo in services.yml
2 parents eadb272 + a741c9c commit 9357aba

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

service_container.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,14 @@ parameter and in PHP config use the ``ref`` function:
500500
# config/services.yaml
501501
services:
502502
App\Service\MessageGenerator:
503-
# this is not a string, but a reference to a service called 'logger'
504-
arguments: ['@logger']
503+
arguments:
504+
# this is not a string, but a reference to a service called 'logger'
505+
- '@logger'
505506
506-
# if the value of a string parameter starts with '@', you need to escape
507-
# it by adding another '@' so Symfony doesn't consider it a service
508-
# (this will be parsed as the string '@securepassword')
509-
mailer_password: '@@securepassword'
507+
# if the value of a string argument starts with '@', you need to escape
508+
# it by adding another '@' so Symfony doesn't consider it a service
509+
# the following example would be parsed as the string '@securepassword'
510+
# - '@@securepassword'
510511
511512
.. code-block:: xml
512513

0 commit comments

Comments
 (0)