Skip to content

Commit 7985533

Browse files
committed
Merge branch '7.3' into 7.4
* 7.3: [DependencyInjection] Update the docs about decoration
2 parents 62bcb4e + ab46ca9 commit 7985533

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
@@ -152,15 +152,17 @@ automatically changed to ``'.inner'``):
152152
namespace App;
153153
154154
// ...
155+
use App\Mailer;
155156
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
156157
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
157158
158159
#[AsDecorator(decorates: Mailer::class)]
159160
class DecoratingMailer
160161
{
161162
public function __construct(
162-
#[AutowireDecorated]
163-
private object $inner,
163+
// unlike other configuration formats, that name the decorated service argument
164+
// as `$inner` by default, when using attributes you can choose any variable name
165+
#[AutowireDecorated] private Mailer $mailer,
164166
) {
165167
}
166168

0 commit comments

Comments
 (0)