From 5eeeb445e2793bc28b635bf9675c2a6b3b4eea6d Mon Sep 17 00:00:00 2001 From: Roel Arents Date: Tue, 31 May 2016 12:30:28 +0200 Subject: [PATCH] fix deprecated ServiceLocatorAwareInterface warning by having the PluginManager factories inject the ServiceLocator themselves resolves #2 --- src/Factory/FormatterPluginManagerFactory.php | 4 +++- src/Factory/HandlerPluginManagerFactory.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Factory/FormatterPluginManagerFactory.php b/src/Factory/FormatterPluginManagerFactory.php index d5915c0..64d6912 100644 --- a/src/Factory/FormatterPluginManagerFactory.php +++ b/src/Factory/FormatterPluginManagerFactory.php @@ -16,7 +16,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $configInstance = new Config($config['monolog']['formatter_plugin_manager']); + $formatterPluginManager = new FormatterPluginManager($configInstance); + $formatterPluginManager->setServiceLocator($serviceLocator); - return new FormatterPluginManager($configInstance); + return $formatterPluginManager; } } diff --git a/src/Factory/HandlerPluginManagerFactory.php b/src/Factory/HandlerPluginManagerFactory.php index 73d5ad6..2fcef3c 100644 --- a/src/Factory/HandlerPluginManagerFactory.php +++ b/src/Factory/HandlerPluginManagerFactory.php @@ -16,7 +16,9 @@ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); $configInstance = new Config($config['monolog']['handler_plugin_manager']); + $handlerPluginManager = new HandlerPluginManager($configInstance); + $handlerPluginManager->setServiceLocator($serviceLocator); - return new HandlerPluginManager($configInstance); + return $handlerPluginManager; } }