From 2ace56b9136a645f6125064f7838ddca2bcd9b88 Mon Sep 17 00:00:00 2001 From: Alexandre Lemaire Date: Wed, 6 Apr 2016 23:33:11 -0400 Subject: [PATCH] Inject the service manager here to prevent the latest zend-mvc from throwing deprecation notices managers that don't have the SL injected cause panic with the latest zend-servicemanager release. See \Zend\Mvc\Service\ServiceManagerConfig ``` // For service locator aware plugin managers that do not have // the service locator already injected, inject it, but emit a // deprecation notice. if ($instance instanceof ServiceLocatorAwareInterface && $instance instanceof AbstractPluginManager && ! $instance->getServiceLocator() ) { trigger_error(sprintf( 'ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along ' . 'with the ServiceLocatorAwareInitializer. Please update your %s plugin manager factory ' . 'to inject the parent service locator via the constructor.', get_class($instance) ), E_USER_DEPRECATED); $instance->setServiceLocator($container); } ``` --- src/ZfcTwig/View/HelperPluginManagerFactory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZfcTwig/View/HelperPluginManagerFactory.php b/src/ZfcTwig/View/HelperPluginManagerFactory.php index 5672f80..7e98b3f 100644 --- a/src/ZfcTwig/View/HelperPluginManagerFactory.php +++ b/src/ZfcTwig/View/HelperPluginManagerFactory.php @@ -28,6 +28,7 @@ public function createService(ServiceLocatorInterface $serviceLocator) $baseManager = $serviceLocator->get('ViewHelperManager'); $twigManager = new HelperPluginManager(new Config($managerOptions)); + $twigManager->setServiceLocator($serviceLocator); $twigManager->addPeeringServiceManager($baseManager); foreach ($managerConfigs as $configClass) { @@ -51,4 +52,4 @@ public function createService(ServiceLocatorInterface $serviceLocator) return $twigManager; } -} \ No newline at end of file +}