From fd05739e1ec0312ade7742360bf300dc81f0b747 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Wed, 4 May 2022 09:41:54 -0400 Subject: [PATCH] [DependencyInjection] adjust `Autowire` attribute docs --- controller.rst | 6 +++--- service_container/autowiring.rst | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) 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 ) { }