diff --git a/service_container/expression_language.rst b/service_container/expression_language.rst index 947946f7805..2f3f7ae2138 100644 --- a/service_container/expression_language.rst +++ b/service_container/expression_language.rst @@ -28,7 +28,9 @@ to another service: ``App\Mailer``. One way to do this is with an expression: App\Mail\MailerConfiguration: ~ App\Mailer: - arguments: ["@=service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()"] + arguments: ['@=service("App\\Mail\\MailerConfiguration").getMailerMethod()'] + # when using double-quoted strings, the backslash needs to be escaped twice (see https://yaml.org/spec/1.2/spec.html#id2787109) + # arguments: ["@=service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()"] .. code-block:: xml