Skip to content

Commit ab46ca9

Browse files
committed
Merge branch '6.4' into 7.3
* 6.4: [DependencyInjection] Update the docs about decoration
2 parents 68f6916 + 6d277d5 commit ab46ca9

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)