/** * Create service * * @param ServiceLocatorInterface $serviceLocator * @return WriterPluginManager */ public function createService(ServiceLocatorInterface $serviceLocator) { $config = $serviceLocator->get('Config'); if (!isset($config[self::OPTIONS_KEY])) { $config[self::OPTIONS_KEY] = []; } $managerOptions = new Config($config[self::OPTIONS_KEY]); $writerManager = new WriterPluginManager($managerOptions); $writerManager->setServiceLocator($serviceLocator); return $writerManager; }