diff --git a/Module.php b/Module.php index 1c183bf..fbbd163 100755 --- a/Module.php +++ b/Module.php @@ -6,14 +6,11 @@ use Zend\ModuleManager\Feature\AutoloaderProviderInterface; use Zend\ModuleManager\Feature\BootstrapListenerInterface; use Zend\ModuleManager\Feature\ConfigProviderInterface; -use Zend\ModuleManager\Feature\ServiceProviderInterface; -use Zend\ServiceManager\ServiceLocatorInterface; class Module implements AutoloaderProviderInterface, ConfigProviderInterface, - BootstrapListenerInterface, - ServiceProviderInterface + BootstrapListenerInterface { /** * Listen to the bootstrap event @@ -43,25 +40,6 @@ public function getConfig() return require __DIR__ . '/configs/module.config.php'; } - /** - * Expected to return \Zend\ServiceManager\Config object or array to - * seed such an object. - * - * @return array|\Zend\ServiceManager\Config - */ - public function getServiceConfig() - { - return [ - 'factories' => [ - 'AsseticBundle\Configuration' => function (ServiceLocatorInterface $serviceLocator) { - $configuration = $serviceLocator->get('Configuration'); - - return new Configuration($configuration['assetic_configuration']); - } - ], - ]; - } - /** * Return an array for passing to Zend\Loader\AutoloaderFactory. * diff --git a/configs/module.config.php b/configs/module.config.php index 99ee8f1..afea7f7 100644 --- a/configs/module.config.php +++ b/configs/module.config.php @@ -16,6 +16,7 @@ 'Assetic\AssetManager' => 'Zend\ServiceManager\Factory\InvokableFactory', 'AsseticBundle\Listener' => 'Zend\ServiceManager\Factory\InvokableFactory', 'AsseticBundle\Cli' => 'AsseticBundle\Cli\ApplicationFactory', + 'AsseticBundle\Configuration' => 'AsseticBundle\Factory\ConfigurationFactory', ], ], diff --git a/src/AsseticBundle/Factory/ConfigurationFactory.php b/src/AsseticBundle/Factory/ConfigurationFactory.php new file mode 100644 index 0000000..12bf4bd --- /dev/null +++ b/src/AsseticBundle/Factory/ConfigurationFactory.php @@ -0,0 +1,17 @@ +get('Configuration'); + + return new Configuration($configuration['assetic_configuration']); + } +}