Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9c6baa3

Browse files
committed
[DependencyInjection] adjustAutowire attribute docs
1 parente7acfd9 commit9c6baa3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎controller.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ command:
239239
int $max,
240240

241241
// inject a specific logger service
242-
#[Autowire('@monolog.logger.request')]
242+
#[Autowire(service: 'monolog.logger.request')]
243243
LoggerInterface $logger,
244244

245245
// or inject parameter values

‎service_container/autowiring.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ problematic arguments:
557557
class MessageGenerator
558558
{
559559
public function __construct(
560-
#[Autowire('@monolog.logger.request')] LoggerInterface $logger
560+
#[Autowire(service: 'monolog.logger.request')] LoggerInterface $logger
561561
) {
562562
// ...
563563
}
@@ -586,8 +586,8 @@ and even :doc:`complex expressions </service_container/expression_language>`::
586586
#[Autowire('%kernel.debug%')]
587587
bool $debugMode,
588588

589-
// and@=... forexpressions
590-
#[Autowire("@=service("App\\Mail\\MailerConfiguration").getMailerMethod()")]
589+
// and expressions
590+
#[Autowire(expression: "service("App\\Mail\\MailerConfiguration").getMailerMethod()")]
591591
string $mailerMethod
592592
) {
593593
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp