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 562ff34 + 7985533 commit 28aa3faCopy full SHA for 28aa3fa
service_container/service_decoration.rst
@@ -110,15 +110,17 @@ automatically changed to ``'.inner'``):
110
namespace App;
111
112
// ...
113
+ use App\Mailer;
114
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
115
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
116
117
#[AsDecorator(decorates: Mailer::class)]
118
class DecoratingMailer
119
{
120
public function __construct(
- #[AutowireDecorated]
121
- private object $inner,
+ // unlike other configuration formats, that name the decorated service argument
122
+ // as `$inner` by default, when using attributes you can choose any variable name
123
+ #[AutowireDecorated] private Mailer $mailer,
124
) {
125
}
126
0 commit comments