Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Implement container-interop #4

Closed
wants to merge 2 commits into from
Closed

Implement container-interop #4

wants to merge 2 commits into from

Conversation

gianarb
Copy link
Contributor

@gianarb gianarb commented Jun 22, 2015

This proposal is a simple implementation of ContainerInterface.
Now we can use it in zend-stratigility-skeleton for example.

This proposal is a simple implementation of ContainerInterface.
Now we can use it in
[zend-stratigility-skeleton](https://github.com/container-interop/container-interop) for example.
@weierophinney
Copy link
Member

My only concern is that the container-interop interfaces were just admitted as a draft PSR... which means there's still a very high liklihood of changes possible. We may want to do this as an "InteropManager" or similar, with documentation in the README indicating it's experimental and unstable until the PSR for container interop is accepted.

@gianarb
Copy link
Contributor Author

gianarb commented Jun 22, 2015

I can try to write a InteropManager that extends Zend\ServiceManager\ServiceManager but implements Interop\Container\ContainerInterface

OR

we can write a little interop project between service manager and interop-container that implement this feature..

Tomorrow if php-fig will release psr about this stuff we can write another interop project with them proposal

@gianarb
Copy link
Contributor Author

gianarb commented Jun 22, 2015

@weierophinney this is a project's draft :)
https://github.com/gianarb/zend-servicemanager-container-interop

easy easy

@weierophinney
Copy link
Member

@gianarb That's exactly what I was suggesting!

Pinging @mvriel : is there a phpdoc annotation for indicating a class or method is "unstable"?

@gianarb
Copy link
Contributor Author

gianarb commented Jun 22, 2015

In your opinion is a good idea builds a new project?

👍 It's clear in my opinion and we can not add unstable class in zend-servicemanager

@mvriel
Copy link

mvriel commented Jun 22, 2015

@weierophinney no, the best you could do is use to mark it using @access protected or @access private; though that tag is deprecated and removed from PSR-5

@sandrokeil
Copy link

Looks good. Maybe one problem could be the optional parameters. I know it's not a problem in PHP but it's not so clean. Isn't it?

@gianarb
Copy link
Contributor Author

gianarb commented Jun 23, 2015

@sandrokeil the intereface is already implemented without modified.. Why could it be a problem?

@sandrokeil
Copy link

@gianarb I think it's confusing because the ContainerInterface function definition is get($id) and in ServiceManager we have get($name, $usePeeringServiceManagers = true). Also in ZF3 it's planned to have public function get($name, array $options = []).

The ServiceLocatorInterface is ok, that's right. But it could be changed in ZF3. So it's magic to call $sl->get('service', $options) or $sl->get('service', false).

So I think it's not real support of interoperability. But we could fix this for ZF3.

@sandrokeil sandrokeil mentioned this pull request Jun 24, 2015
@Ocramius
Copy link
Member

My only concern is that the container-interop interfaces were just admitted as a draft PSR...

container-interop as-is is a project on its own. It will maybe become a PSR, yes /cc @moufmouf

@gianarb I think it's confusing because the ContainerInterface function definition is get($id) and in ServiceManager we have get($name, $usePeeringServiceManagers = true).

Note that this is perfectly legit PHP

@weierophinney
Copy link
Member

Based on the feedback from @Ocramius, I'm 👍 - however, it looks like we need to add a little more test coverage, @gianarb - this small change has decreased coverage. :)

@weierophinney weierophinney added this to the 2.6.0 milestone Jul 6, 2015
@weierophinney weierophinney self-assigned this Jul 6, 2015
weierophinney added a commit that referenced this pull request Jul 6, 2015
weierophinney added a commit that referenced this pull request Jul 6, 2015
@weierophinney
Copy link
Member

Merged to develop for release with 2.6.0.

@@ -13,7 +13,8 @@
}
},
"require": {
"php": ">=5.5"
"php": ">=5.5",
"container-interop/container-interop": "*"
Copy link
Member

Choose a reason for hiding this comment

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

Note: this should be a constrained version (1.0.*)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry #5

weierophinney pushed a commit that referenced this pull request Sep 15, 2016
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.

5 participants