Skip to content

Commit 7ec6d9d

Browse files
committed
[DependencyInjection] Bind tagged services
1 parent 45d54a0 commit 7ec6d9d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

service_container.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
665665
# optionally you can define both the name and type of the argument to match
666666
string $adminEmail: 'manager@example.com'
667667
Psr\Log\LoggerInterface $requestLogger: '@monolog.logger.request'
668+
iterable $rules: !tagged_iterator app.foo.rule
668669
669670
# ...
670671
@@ -695,6 +696,10 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
695696
type="service"
696697
id="monolog.logger.request"
697698
/>
699+
<bind key="iterable $rules"
700+
type="tagged_iterator"
701+
tag="app.foo.rule"
702+
/>
698703
</defaults>
699704
700705
<!-- ... -->
@@ -728,6 +733,7 @@ You can also use the ``bind`` keyword to bind specific arguments by name or type
728733
// optionally you can define both the name and type of the argument to match
729734
->bind('string $adminEmail', 'manager@example.com')
730735
->bind(LoggerInterface::class.' $requestLogger', ref('monolog.logger.request'))
736+
->bind('iterable $rules', tagged_iterator('app.foo.rule'))
731737
;
732738
733739
// ...

0 commit comments

Comments
 (0)