Skip to content

Commit ea9fa22

Browse files
committed
Merge branch '4.4' into 5.3
* 4.4: Added a comment to the code Adds proper escaping for php service config format Note that parameter names for Attribute constructors are covered [DependencyInjection] add missing use statements
2 parents ef6e6ba + 209e939 commit ea9fa22

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

contributing/code/bc.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@ Turn static into non static No
448448
449449
.. [9] Allowed for the ``void`` return type.
450450
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.
454454
455455
.. _`Semantic Versioning`: https://semver.org/

service_container.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ service's class or interface name. Want to :doc:`log </logging>` something? No p
3333

3434
use Psr\Log\LoggerInterface;
3535
use Symfony\Component\HttpFoundation\Response;
36+
use Symfony\Component\Routing\Annotation\Route;
3637

3738
class ProductController
3839
{
@@ -119,6 +120,7 @@ inside your controller::
119120
// src/Controller/ProductController.php
120121
use App\Service\MessageGenerator;
121122
use Symfony\Component\HttpFoundation\Response;
123+
use Symfony\Component\Routing\Annotation\Route;
122124

123125
/**
124126
* @Route("/products/new")

service_container/expression_language.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ 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+
// because of the escaping applied by PHP, you must add 4 backslashes for each original backslash
71+
->args([expr("service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()")]);
7172
};
7273
7374
To learn more about the expression language syntax, see :doc:`/components/expression_language/syntax`.

0 commit comments

Comments
 (0)