diff --git a/controller.rst b/controller.rst index 00da69fc15c..2eb1af1fe03 100644 --- a/controller.rst +++ b/controller.rst @@ -225,8 +225,8 @@ command: .. tip:: - If you need control over the *exact* value of an argument, you can use the - ``#[Autowire]`` attribute:: + If you need control over the *exact* value of an argument, or require a parameter, + you can use the ``#[Autowire]`` attribute:: // ... use Psr\Log\LoggerInterface; @@ -239,7 +239,7 @@ command: int $max, // inject a specific logger service - #[Autowire('@monolog.logger.request')] + #[Autowire(service: 'monolog.logger.request')] LoggerInterface $logger, // or inject parameter values diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index b5387415614..a4a6f63bbcb 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -545,8 +545,8 @@ To fix this, you can :ref:`manually wire the problematic argument `:: #[Autowire('%kernel.debug%')] bool $debugMode, - // and @=... for expressions - #[Autowire("@=service("App\\Mail\\MailerConfiguration").getMailerMethod()")] + // and expressions + #[Autowire(expression: "service("App\\Mail\\MailerConfiguration").getMailerMethod()")] string $mailerMethod ) { }