Skip to content
Snippets Groups Projects
Commit c89acb5a authored by Sebastian Kehr's avatar Sebastian Kehr Committed by Demian Katz
Browse files

Allow delegator factories upon plugin validation. (#1125)

parent 66cb6b2f
No related merge requests found
......@@ -28,6 +28,7 @@
namespace VuFind\ServiceManager;
use Zend\ServiceManager\AbstractPluginManager as Base,
Zend\ServiceManager\ConfigInterface,
Zend\ServiceManager\DelegatorFactoryInterface,
Zend\ServiceManager\Exception\RuntimeException as ServiceManagerRuntimeException;
/**
......@@ -74,8 +75,12 @@ abstract class AbstractPluginManager extends Base
*/
public function validatePlugin($plugin)
{
if ($plugin instanceof DelegatorFactoryInterface) {
return;
}
$expectedInterface = $this->getExpectedInterface();
if (!($plugin instanceof $expectedInterface)) {
if (!$plugin instanceof $expectedInterface) {
throw new ServiceManagerRuntimeException(
'Plugin ' . get_class($plugin) . ' does not belong to '
. $expectedInterface
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment