-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
DependencyInjectionFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | not sure |
RFC? | yes |
Symfony version | 3.3.5 |
Although a documentation doesn't describe it, tagged services can be injected via
$definition->replaceArgument(1, $arrayOfTransportDefinitions);
In all of cases I worked, a service would ever accept only one type of tagged services. Can this be used to have services autowired like this:
class TransportChain
{
public function __construct(LoggerInterface $logger, TransportInterface ...$transports)
{
// ....
}
This way user would not have to write compiler pass, giving better experience. The con is lack of injecting multiple tagged services but I don't think users do it anyway.
ro0NL, zyv4yk and andreo-codeTomasVotruba
Metadata
Metadata
Assignees
Labels
DependencyInjectionFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)