Skip to content

Commit

Permalink
fix to only setServiceLocator in factories if ZF version < 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel Arents committed Aug 29, 2016
1 parent cbc6cc2 commit 0bdeef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Factory/FormatterPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$container,
$config['monolog']['formatter_plugin_manager']
);
$formatterPluginManager->setServiceLocator($container);
if (class_exists('Zend\Version\Version') && \Zend\Version\Version::compareVersion('3.0') >=1) {
$formatterPluginManager->setServiceLocator($container);
}
return $formatterPluginManager;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Factory/HandlerPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$container,
$config['monolog']['handler_plugin_manager']
);
$handlerPluginManager->setServiceLocator($container);
if (class_exists('Zend\Version\Version') && \Zend\Version\Version::compareVersion('3.0') >=1) {
$handlerPluginManager->setServiceLocator($container);
}
return $handlerPluginManager;
}

Expand Down

0 comments on commit 0bdeef1

Please sign in to comment.