Create service

@param ServiceLocatorInterface $serviceLocator

@return mixed
178693
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var $serviceLocator \Zend\View\HelperPluginManager */
        $this->serviceManager = $serviceLocator->getServiceLocator();

        $config = $this->serviceManager->get('Config');
        $config = (isset($config['yima-jquery']) && is_array($config['yima-jquery']))
            ? $config['yima-jquery']
            : array();

        // add deliver libraries
        $conf = (isset($config['deliveries'])) ? $config['deliveries'] : array();
        if (!empty($conf) && is_array($conf)) {
            $this->setDeliverLibs($conf);
        }

        // add decorator
        $conf = (isset($config['decorator'])) ? $config['decorator'] : '';
        if (!empty($conf)) {
            $this->setDecorator($conf);
        }

        return $this->helper;
    }
943798
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceLocator = $serviceLocator->getServiceLocator();
        $helper = new FlashMessenger();
        $controllerPluginManager = $serviceLocator->get('ControllerPluginManager');
        $flashMessenger = $controllerPluginManager->get('flashmessenger');
        $helper->setPluginFlashMessenger($flashMessenger);
        $config = $serviceLocator->get('Config');
        if (isset($config['view_helper_config']['flashmessenger'])) {
            $configHelper = $config['view_helper_config']['flashmessenger'];
            if (isset($configHelper['message_open_format'])) {
                $helper->setMessageOpenFormat($configHelper['message_open_format']);
            }

            if (isset($configHelper['message_separator_string'])) {
                $helper->setMessageSeparatorString($configHelper['message_separator_string']);
            }

            if (isset($configHelper['message_close_string'])) {
                $helper->setMessageCloseString($configHelper['message_close_string']);
            }

            if (!empty($configHelper['class_messages'])) {
                $helper->setClassMessages($configHelper['class_messages']);
            }
        }

        return $helper;
    }
1344435
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $config = $config['cronModule'];

        return new CronService(new Configuration($config));
    }
1250380
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Eye4web\Zf2Board\Options\ModuleOptions $moduleOptions */
        $moduleOptions = $serviceLocator->get('Eye4web\Zf2Board\Options\ModuleOptions');

        $entityName = $moduleOptions->getTopicEntity();
        $object = new $entityName;

        $form = new CreateForm($object);

        return $form;
    }
748188
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $instance = new Workflow();
        $instance->setWorkflowFinder($serviceLocator->getServiceLocator()->get(\Prooph\Link\ProcessManager\Projection\Workflow\WorkflowFinder::class));
        return $instance;
    }
373395
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $pathManager = $serviceLocator->get('pathmanager');
        $path = $pathManager->get('cache', 'doctrine');
        $cache = new FilesystemCache($path);

        return $cache;
    }
1061658
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $em = new EventManager();
        $em->setSharedManager($serviceLocator->get('SharedEventManager'));

        return $em;
    }
657371
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appServiceLocator = $serviceLocator;
        if ($serviceLocator instanceof AbstractPluginManager) {
            $appServiceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
        $moduleOptionsPluginManager = $appServiceLocator->get(ModuleOptionsPluginManagerInterface::class);

        $resolverByModuleContextMap = new ResolverByClassName($moduleOptionsPluginManager);

        return $resolverByModuleContextMap;
    }
1332811
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsPluginManager */
        $moduleOptionsPluginManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);

        /** @var ModuleOptionsInterface $moduleOptions */
        $moduleOptions = $moduleOptionsPluginManager->get(ModuleOptionsInterface::class);

        $metadataReaderCacheServiceName = $moduleOptions->getMetadataReaderCache();

        /** @var Cache $metadataReaderCache */
        $metadataReaderCache = $serviceLocator->get($metadataReaderCacheServiceName);

        $reader = new AnnotationReader();
        $reader = new CachedReader($reader, $metadataReaderCache);

        return new DiscriminatorEntryListener($reader);
    }
1253913
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var $env Environment */
        $env = $serviceLocator->get(Definition::SERVICE_ENVIRONMENT);

        return new WorkflowProcessor(
            $env->getNodeName(),
            $env->getEventStore(),
            $env->getProcessRepository(),
            $env->getWorkflowEngine(),
            $env->getProcessFactory()
        );
    }
833108
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $parser = $serviceLocator->get('ControllerNameParser');
        $logger = $serviceLocator->has('Logger') ? $serviceLocator->get('Logger') : null;

        return new ControllerResolver($serviceLocator, $parser, $logger);
    }
716865
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var array  $appConfig */
        $appConfig = $serviceLocator->get('config');
        $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig['doctrine'] : [];

        /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */
        $moduleOptionsManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class);
        /** @var ModuleOptionsInterface $moduleOptions */
        $moduleOptions = $moduleOptionsManager->get(ModuleOptionsInterface::class);

        return new DoctrineOrmModuleConfig($doctrineConfig, $moduleOptions);
    }
452531
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $config = $config['EddieJaoude\Zf2Logger'];
        $this->logger = new Logger();

        $this->configuration($config);
        $this->writerCollection($config);
        $this->execute();

        return $this->logger;
    }
760604
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof AbstractPluginManager) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        $container = $this->getContainer($serviceLocator);
        $plugin = new ToastViewHelper($container);

        return $plugin;
    }
872787
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var \Eye4web\Zf2Board\Options\ModuleOptions $options */
        $options = $serviceLocator->get('Eye4web\Zf2Board\Options\ModuleOptions');

        /** @var \Eye4web\Zf2Board\Mapper\PostMapperInterface $mapper */
        $mapper = $serviceLocator->get($options->getPostMapper());

        /** @var Form $postCreateForm */
        $postCreateForm = $serviceLocator->get('Eye4web\Zf2Board\Form\Post\CreateForm');

        /** @var Form $postEditForm */
        $postEditForm = $serviceLocator->get('Eye4web\Zf2Board\Form\Post\EditForm');

        $service = new PostService($mapper, $postCreateForm, $postEditForm);

        return $service;
    }
827687
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var array $appConfig */
        $appConfig = $serviceLocator->get('config');
        $config = [];
        if (array_key_exists(Module::CONFIG_KEY, $appConfig)) {
            $config = $appConfig[Module::CONFIG_KEY];
        }
        $moduleOptions = new ModuleOptions($config);
        return $moduleOptions;
    }
1319332
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new Environment();

        /** @var EnvironmentRepositoryInterface $environmentRepository */
        $environmentRepository = $serviceLocator->get('EnvironmentRepository');
        $service->setEnvironmentRepository($environmentRepository);

        return $service;
    }