This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Fixes issue with using InputFilterAbstractFactory with application services #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As reported in #123, under zend-servicemanager v2, the
InputFilterAbstractFactory
raises a fatal error when callinggetServiceLocator()
if the container passed to the abstract factory is not a plugin manager, but instead the application-level service container.This patch updates the implementation to add some detection to determine if the container is a plugin manager when used under v2, and, if so, only then attempt to pull the parent service container. Additionally, it will now use itself if no parent container is present (this will typically cause the
canCreate()
test to fail anyways).All typehints on
ServiceLocatorInterface
were modified toContainerInterface
unless they were part of an existing interface definition, to ensure inner consistency, and forwards compatibility with v3.