We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 68f6916 + 6d277d5 commit ab46ca9Copy full SHA for ab46ca9
service_container/service_decoration.rst
@@ -142,15 +142,17 @@ automatically changed to ``'.inner'``):
142
namespace App;
143
144
// ...
145
+ use App\Mailer;
146
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
147
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
148
149
#[AsDecorator(decorates: Mailer::class)]
150
class DecoratingMailer
151
{
152
public function __construct(
- #[AutowireDecorated]
153
- private object $inner,
+ // 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,
156
) {
157
}
158
0 commit comments