Closed
Description
Since #30257 we can inject complex tagged collections easily.
The only thing left before PHP gets generics is compile-time checking of the collection item type.
The syntax I propose:
services:
foo_service:
class: Foo
tags:
- foo
bar:
class: Bar
arguments:
- !tagged
tag: foo
# new attribute
instanceof: FooInterface
Note that having the foo
tag does not imply being an instance of FooInterface
.