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 62bcb4e + ab46ca9 commit 7985533Copy full SHA for 7985533
service_container/service_decoration.rst
@@ -152,15 +152,17 @@ automatically changed to ``'.inner'``):
152
namespace App;
153
154
// ...
155
+ use App\Mailer;
156
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
157
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
158
159
#[AsDecorator(decorates: Mailer::class)]
160
class DecoratingMailer
161
{
162
public function __construct(
- #[AutowireDecorated]
163
- private object $inner,
+ // 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,
166
) {
167
}
168
0 commit comments