container-interop / container-interop

Containers interoperability

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why not a DelegateLookupCapableContainerInterface?

jjanvier opened this issue · comments

Maybe it's a stupid question, and maybe it has already been discussed (my apologies if it's the case). I do understand and agree with the arguments explained here.

But why didn't you provide such an interface?

namespace Psr\Container;

interface DelegateLookupCapableContainerInterface extends ContainerInterface
{
}

Because currently the delegate lookup feature relies only on the PSR document. This stupid and simple interface would allow us to identify which containers support this feature.

NB: I don't know if I should post this question here, or in the php-fig mailing list.

Actually, the delegate lookup feature was completely removed from PSR-11 (sadly) on the ground that it is a design-pattern and so does not need to be part of a PSR. So there is no chance the DelegateLookupCapableContainerInterface could be part of a PSR.

Also, even if you COULD identify which container has the delegate lookup feature, the interface would be of little help since it would not tell you how to use it.