Skip to content

Commit 28aa3fa

Browse files
committed
Merge branch '7.4' into 8.0
* 7.4: [DependencyInjection] Update the docs about decoration
2 parents 562ff34 + 7985533 commit 28aa3fa

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
@@ -110,15 +110,17 @@ automatically changed to ``'.inner'``):
110110
namespace App;
111111
112112
// ...
113+
use App\Mailer;
113114
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
114115
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
115116
116117
#[AsDecorator(decorates: Mailer::class)]
117118
class DecoratingMailer
118119
{
119120
public function __construct(
120-
#[AutowireDecorated]
121-
private object $inner,
121+
// 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,
122124
) {
123125
}
124126

0 commit comments

Comments
 (0)