Skip to content

Commit b5f1dca

Browse files
committed
minor #15766 Adds proper escaping for php service config format (faizanakram99)
This PR was submitted for the 5.4 branch but it was merged into the 4.4 branch instead. Discussion ---------- Adds proper escaping for php service config format php configs need `\\\\`, `\\` are not enough. `"service('App\\Mailer')"` compiles into `AppMailer` , `"service('App\\\\Mailer')"` compiles correctly into `App\Mailer` <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- 88c25e1 Adds proper escaping for php service config format
2 parents 24a7c37 + 88c25e1 commit b5f1dca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service_container/expression_language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
6767
$services->set(MailerConfiguration::class);
6868
6969
$services->set(Mailer::class)
70-
->args([expr("service('App\\Mail\\MailerConfiguration').getMailerMethod()")]);
70+
->args([expr("service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()")]);
7171
};
7272
7373
To learn more about the expression language syntax, see :doc:`/components/expression_language/syntax`.

0 commit comments

Comments
 (0)