File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -448,8 +448,8 @@ Turn static into non static No
448
448
449
449
.. [9 ] Allowed for the ``void `` return type.
450
450
451
- .. [10 ] Parameter names are not part of the compatibility promise. Using
452
- PHP 8's named arguments feature might break your code when upgrading to
453
- newer Symfony versions.
451
+ .. [10 ] Parameter names are only covered by the compatibility promise for
452
+ constructors of Attribute classes. Using PHP named arguments might
453
+ break your code when upgrading to newer Symfony versions.
454
454
455
455
.. _`Semantic Versioning` : https://semver.org/
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ service's class or interface name. Want to :doc:`log </logging>` something? No p
33
33
34
34
use Psr\Log\LoggerInterface;
35
35
use Symfony\Component\HttpFoundation\Response;
36
+ use Symfony\Component\Routing\Annotation\Route;
36
37
37
38
class ProductController
38
39
{
@@ -119,6 +120,7 @@ inside your controller::
119
120
// src/Controller/ProductController.php
120
121
use App\Service\MessageGenerator;
121
122
use Symfony\Component\HttpFoundation\Response;
123
+ use Symfony\Component\Routing\Annotation\Route;
122
124
123
125
/**
124
126
* @Route("/products/new")
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
67
67
$services->set(MailerConfiguration::class);
68
68
69
69
$services->set(Mailer::class)
70
- ->args([expr("service('App\\Mail\\MailerConfiguration').getMailerMethod()")]);
70
+ // because of the escaping applied by PHP, you must add 4 backslashes for each original backslash
71
+ ->args([expr("service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()")]);
71
72
};
72
73
73
74
To learn more about the expression language syntax, see :doc: `/components/expression_language/syntax `.
You can’t perform that action at this time.
0 commit comments