@@ -289,35 +289,35 @@ the ``decoration_priority`` option. Its value is an integer that defaults to
289
289
290
290
.. configuration-block ::
291
291
292
- .. code-block :: php-attributes
292
+ .. code-block :: php-attributes
293
293
294
- // ...
295
- use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
296
- use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
294
+ // ...
295
+ use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
296
+ use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
297
297
298
- #[AsDecorator(decorates: Foo::class, priority: 5)]
299
- class Bar
300
- {
301
- public function __construct(
302
- #[AutowireDecorated]
303
- private $inner,
304
- ) {
305
- }
306
- // ...
298
+ #[AsDecorator(decorates: Foo::class, priority: 5)]
299
+ class Bar
300
+ {
301
+ public function __construct(
302
+ #[AutowireDecorated]
303
+ private $inner,
304
+ ) {
307
305
}
306
+ // ...
307
+ }
308
308
309
- #[AsDecorator(decorates: Foo::class, priority: 1)]
310
- class Baz
311
- {
312
- public function __construct(
313
- #[AutowireDecorated]
314
- private $inner,
315
- ) {
316
- }
317
-
318
- // ...
309
+ #[AsDecorator(decorates: Foo::class, priority: 1)]
310
+ class Baz
311
+ {
312
+ public function __construct(
313
+ #[AutowireDecorated]
314
+ private $inner,
315
+ ) {
319
316
}
320
317
318
+ // ...
319
+ }
320
+
321
321
.. code-block :: yaml
322
322
323
323
# config/services.yaml
@@ -609,24 +609,24 @@ Three different behaviors are available:
609
609
610
610
.. configuration-block ::
611
611
612
- .. code-block :: php-attributes
613
-
614
- // ...
615
- use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
616
- use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
617
- use Symfony\Component\DependencyInjection\ContainerInterface;
612
+ .. code-block :: php-attributes
618
613
619
- #[AsDecorator(decorates: Mailer::class, onInvalid: ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]
620
- class Bar
621
- {
622
- public function __construct(
623
- #[AutowireDecorated] private $inner,
624
- ) {
625
- }
614
+ // ...
615
+ use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
616
+ use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
617
+ use Symfony\Component\DependencyInjection\ContainerInterface;
626
618
627
- // ...
619
+ #[AsDecorator(decorates: Mailer::class, onInvalid: ContainerInterface::IGNORE_ON_INVALID_REFERENCE)]
620
+ class Bar
621
+ {
622
+ public function __construct(
623
+ #[AutowireDecorated] private $inner,
624
+ ) {
628
625
}
629
626
627
+ // ...
628
+ }
629
+
630
630
.. code-block :: yaml
631
631
632
632
# config/services.yaml
0 commit comments