Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Add PSR-11 support #450

Merged
merged 6 commits into from
Feb 15, 2017
Merged

Add PSR-11 support #450

merged 6 commits into from
Feb 15, 2017

Conversation

geerteltink
Copy link
Member

Replaces:

  • Interop\Container\ContainerInterface => Psr\Container\ContainerInterface
  • Interop\Container\Exception\ContainerException => Psr\Container\ContainerExceptionInterface
  • Interop\Container\Exception\NotFoundException => Psr\Container\NotFoundExceptionInterface

Updates all container-interop references in the docs.

Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this PR a BC Break? We have now typehints for different classes/interfaces, so if somebody extends one of our classes needs to update his source as well. Am I wrong?

composer.json Outdated
"psr/http-message": "^1.0",
"psr/container": "^1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have here alphabetical order, so psr/container before psr/http-message, please?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make this fully BC by requiring:

  • "container-interop/container-interop": "^1.2"
  • "psr/container": "^1.0"

That way, if folks are still type-hinting on container-interop interfaces, their code will continue to work. We can message then that we'll be removing support for container-interop in the next major version (v3).

One reason we can't go full-on with psr/container quite yet is because none of the supported containers currently support it. Until there are versions that do, we'd actually make Expressive useless!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... we can't change namespaces in expressive 1.X to Psr\Container ... it will be BC break.

I think we can do it with v2 (as it is not yet released), because container-interop 1.2 extends psr-container, so for example ServiceManager with container-interop 1.2 is actually PSR-11 compatible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternately, we could have a conflict section:

"require": {
    "psr/container": "^1.0"
},
"conflict: {
    "container-interop/container-interop": "<1.2.0"
}

Since the various container implementations we support all require container-interop currently, and version 1.2.0 of container-interop extends the various psr/container interfaces, then an update would grab that version, and the various typehints we use would work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xtreamwayz Can you re-target this PR at the develop branch, and add the conflict statement I've suggested above? If so, I'll give it a spin, and see how my various applications work with it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weierophinney I was suggesting adding "conflict" in my comment below ;-)
#450 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@webimpress Don't worry, I have seen it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xtreamwayz Please sort packages in alphabetical order as I requested in first comment. Thx!

@michalbundyra
Copy link
Member

I can see that tests fails also with lowest dependencies, maybe we should add:

    "conflict": {
        "container-interop/container-interop": "<1.2"
    },

into composer.json?

@geerteltink
Copy link
Member Author

geerteltink commented Feb 15, 2017 via email

@geerteltink geerteltink changed the base branch from master to develop February 15, 2017 17:26
@geerteltink
Copy link
Member Author

@weierophinney Rebased on develop. The docs need to be checked again.

@weierophinney
Copy link
Member

Labeled as BC break, as anybody extending the various classes where signatures have typehints against container-interop would break — this is, of course, also why it's put in the 2.0.0 milestone.

@weierophinney weierophinney merged commit 1758878 into zendframework:develop Feb 15, 2017
weierophinney added a commit that referenced this pull request Feb 15, 2017
Add PSR-11 support

Conflicts:
	composer.lock
weierophinney added a commit that referenced this pull request Feb 15, 2017
weierophinney added a commit that referenced this pull request Feb 15, 2017
@weierophinney
Copy link
Member

Thanks, @xtreamwayz!

@geerteltink geerteltink deleted the hotfix/psr-11 branch February 15, 2017 19:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants