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

Code refactor with the new zend-servicemanager of ZF3 #2

Merged

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Oct 16, 2015

This PR contains the code refactor using the new zend-servicemanager of ZF3.

@@ -45,7 +58,7 @@ class AdapterPluginManager extends AbstractPluginManager
* @return void
* @throws Exception\RuntimeException if invalid
*/
public function validatePlugin($plugin)
public function validate($plugin)
Copy link
Member

Choose a reason for hiding this comment

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

If you define the protected class property $instanceOf and assign it the value of Adapter\AdapterInterface::class, you can get rid of this method entirely. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, but in this way we are going to change the exception from Zend\Serializer\Exception\RuntimeException to Zend\ServiceManager\Exception\InvalidServiceException.

Copy link
Member

Choose a reason for hiding this comment

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

That's okay, and intended; it ensures that the exceptions thrown from plugin managers are consistent.

Copy link
Member

Choose a reason for hiding this comment

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

Also, it ensures we're throwing container-interop exceptions, which we should be doing from plugin managers and factories and whatnot at this point; makes it easier for implementations to catch such exceptions and report them.

@weierophinney weierophinney merged commit f108a33 into zendframework:develop Oct 16, 2015
weierophinney added a commit that referenced this pull request Oct 16, 2015
Code refactor with the new zend-servicemanager of ZF3
weierophinney added a commit that referenced this pull request Oct 16, 2015
weierophinney added a commit that referenced this pull request Oct 16, 2015
@michalbundyra michalbundyra removed this from the 3.0.0 milestone Oct 19, 2019
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