Skip to content

Make ContainerInterface::get a generic - #52

Open
CarlSchwan wants to merge 1 commit into
php-fig:masterfrom
CarlSchwan:carl/container-generic
Open

Make ContainerInterface::get a generic#52
CarlSchwan wants to merge 1 commit into
php-fig:masterfrom
CarlSchwan:carl/container-generic

Conversation

@CarlSchwan

Copy link
Copy Markdown

If we prove a class-string to the get method, returns the class T. If we provide anything yet, return the current mixed result.

If we prove a class-string<T> to the get method, returns the class T. If
we provide anything yet, return the current mixed result.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@KorvinSzanto

Copy link
Copy Markdown

This should be applied to a subtype rather than to the base interface. Just because I'm passing a class string doesn't guarantee I want the same class type out.

For example I could have a ControllerMetadataContainer that returns metadata instances when given a controller class string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants