Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PSR-11? #90

Closed
mnapoli opened this issue Feb 8, 2017 · 6 comments
Closed

Implement PSR-11? #90

mnapoli opened this issue Feb 8, 2017 · 6 comments

Comments

@mnapoli
Copy link
Member

mnapoli commented Feb 8, 2017

Hi everyone :)

For those not following the latest events, PSR-11 has gone into vote and it's going quite well. If it passes, what should we do (and what can we do)?

Is there any technical reason not to implement PSR-11?

Should we deprecate container-interop?

My opinion for what it's worth:

  • if there is nothing preventing that, this package should extend PSR-11 (for an easy migration)
  • it could be deprecated, but we shouldn't forget about the dependency lookup feature (which is not included in PSR-11)
@Sam-Burns
Copy link
Contributor

I'm sure there are a lot of other aspects to consider, but it's worth giving some thought to composite containers like Ultra-Lite and Acclimate.

These currently do things like:

public function addDelegateContainer(\Interop\Container\ContainerInterface $delegate)

I would rather not have to switch to:

public function addDelegateContainer($delegate)
{
    if (
        !$delegate instanceof \Interop\Container\ContainerInterface
        && !$delegate instanceof \Psr\Container\ContainerInterface
    ) {
    throw //...

Simple interface inheritance would seem to solve that problem for us.

One way or the other though, adding support for PSR-11 seems likely, even if it means just providing LTS Container-Interop support and phasing it out for new versions.

@Ocramius
Copy link
Member

Ocramius commented Feb 8, 2017 via email

@moufmouf
Copy link
Contributor

moufmouf commented Feb 8, 2017

Actually, I was thinking about writing a PR for this.

Huge 👍 too.

There is nothing that prevents us from extending PSR-11 interfaces and we should definitely do it. The container-interop definition of NotFoundException is vague enough so that it can fit in the very broad definition adopted by PSR-11.

Regarding deprecating "container-interop", the only thing that is in container-interop and that is not in PSR-11 is the delegate lookup feature, but as stated on the PHP-FIG mailing list, this is a design pattern. So deprecating the package does not mean deprecating the design pattern in my opinion. The design pattern lives by itself :)

So 👍 for deprecating the package too. We might want to think about a way to keep the text about the delegate lookup feature in another repository though, in order not to loose the work done on it.... A Couscous website maybe?

@Potherca
Copy link

Potherca commented Feb 8, 2017

👍 for

  • \Interop\Container\ContainerInterface exends \Psr\Container\ContainerInterface
  • deprecating container-interop

In regards to the delegate lookup feature, documentation seems the way to go (like the phpleague, for example). The question would be where does such documentation belong?

(On a side-note, voting currently stands at 17, all in favour 😸)

@shochdoerfer
Copy link
Contributor

First of all, awesome work guys! Never thought that this could ever happen given the feedback I got back in 2011 / 2012 when I proposed the idea to the FIG.

Is it really worth to let container-interop extend PSR-11? I mean I guess most libs should pretty soon move to PSR-11? I mean it does not hurt but I wonder if it is worth it? Especially when container-interop would be deprecated the same time.

@Ocramius
Copy link
Member

Ocramius commented Feb 9, 2017 via email

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

No branches or pull requests

6 participants