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

Commitab46ca9

Browse files
committed
Merge branch '6.4' into 7.3
* 6.4: [DependencyInjection] Update the docs about decoration
2 parents68f6916 +6d277d5 commitab46ca9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎service_container/service_decoration.rst‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,17 @@ automatically changed to ``'.inner'``):
142142
namespace App;
143143
144144
// ...
145+
use App\Mailer;
145146
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
146147
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
147148
148149
#[AsDecorator(decorates: Mailer::class)]
149150
class DecoratingMailer
150151
{
151152
public function __construct(
152-
#[AutowireDecorated]
153-
private object $inner,
153+
// unlike other configuration formats, that name the decorated service argument
154+
// as `$inner` by default, when using attributes you can choose any variable name
155+
#[AutowireDecorated] private Mailer $mailer,
154156
) {
155157
}
156158

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp