Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Symfony version | 4.1 |
Would be sibling to ServiceSubscriberInterface
.
Could be added to ServiceLocator
, to provide reflection on the inner of the locator.
ServiceProviderInterface::getProvidedService()
would return an array, keyed by service names, and valued by service types. Special value "?"
would mean "mixed" == "dunno" (or null
? but this'd mean isset()
wouldn't work on the array.)
The implementation on ServiceLocator
would just use reflection on the closures and return their return-type hint.
The benefit of using ? for unknown types is that if one want to know if such a type can be null, then the logic is invariably '?' === $type[0]
. Any other convention would require more code.
Metadata
Metadata
Assignees
Labels
RFC = 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)