Create service

@param ServiceLocatorInterface $serviceLocator
@return mixed
6073
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new Environment();

        /** @var Client $pmProxyClient */
        $pmProxyClient = $serviceLocator->get('KmbPmProxy\Client');
        $service->setPmProxyClient($pmProxyClient);

        /** @var HydratorInterface $environmentHydrator */
        $environmentHydrator = $serviceLocator->get('KmbPmProxy\Hydrator\EnvironmentHydrator');
        $service->setEnvironmentHydrator($environmentHydrator);

        return $service;
    }
902926
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');

        $dmmConfig = isset($config['thorr_persistence_dmm'])
            ? new DataMapperManagerConfig($config['thorr_persistence_dmm'])
            : null;

        $dataMapperManager = new DataMapperManager($dmmConfig);
        $dataMapperManager->setServiceLocator($serviceLocator);

        if (isset($config['di']) && $serviceLocator->has('Di')) {
            $dataMapperManager->addAbstractFactory($serviceLocator->get('DiAbstractServiceFactory'));
        }

        return $dataMapperManager;
    }
1335837
public function createService(ServiceLocatorInterface $serviceLocator)
    {

        /** @var ApiProblemRenderer $apiProblemRenderer */
        $apiProblemRenderer = $serviceLocator->get(ApiProblemRenderer::class);

        $renderer = new WorkflowDescriptorApiRenderer($apiProblemRenderer);
        return $renderer;
    }
53246
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof ServiceLocatorAwareInterface) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var \Zend\ServiceManager\ServiceLocatorInterface $viewHelperManager */
        $viewHelperManager = $serviceLocator->get('ViewHelperManager');
        /** @var \Zend\View\Helper\HeadLink $headLink */
        $headLink = $viewHelperManager->get('HeadLink');
        /** @var ServiceLocatorInterface $domainManager */
        $domainManager = $serviceLocator->get('MamuzBlog\DomainManager');
        /** @var \MamuzBlogFeed\Feed\Writer\BuilderInterface $builder */
        $builder = $domainManager->get('MamuzBlogFeed\Feed\WriterFactory');
        /** @var \MamuzBlogFeed\Options\ConfigProviderInterface $configProvider */
        $configProvider = $domainManager->get('MamuzBlogFeed\Options\ConfigProvider');

        return new HeadLinkAggregate($headLink, $builder, $configProvider);
    }
272531
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /**
         * @var \Zend\ServiceManager\ServiceLocatorAwareTrait $serviceLocator
         */
        $sl = $serviceLocator->getServiceLocator();

        /**
         * @var \Mp3\InputFilter\Search $inputFilterSearch
         */
        $inputFilterSearch = $sl->get('InputFilterManager')
                                ->get('Mp3\InputFilter\Search');

        /**
         * @var \Mp3\Form\Search $formSearch
         */
        $formSearch = $sl->get('FormElementManager')
                         ->get('Mp3\Form\Search');

        /**
         * @var \Mp3\Service\Search $serviceSearch
         */
        $serviceSearch = $sl->get('Mp3\Service\Search');

        return new SearchController(
            $inputFilterSearch,
            $formSearch,
            $serviceSearch
        );
    }
67769
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        //--------------------------------
        //data steps
        //  fetch
        //  filter
        //  sanitize
        //  parse
        //--------------------------------
        $fetch  = new FetchApplicationOutput();
        $dump   = new DumpConfigurationContent();

        $fetch->setCommand(new Command());
        $dump->setTimestamp(time());

        $pipe = new Pipe(
            //fetch data
            $fetch,
            //filter data
            new RemoveFirstLinesAndLastLine(),
            new RemoveColorsAndModuleHeadlines(),
            //sanitize data
            new RemoveIndexDotPhpFromLines(),
            //parse data
            new ParseToConfiguration(),
            $dump
        );

        return $pipe;
    }
757218
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $manager = parent::createService($serviceLocator);
        if ($serviceLocator instanceof ServiceManager) {
            $manager->addPeeringServiceManager($serviceLocator);
        }

        return  $manager;
    }
52291
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
        /* @var $plugins \Zend\ServiceManager\AbstractPluginManager */
        $plugins = new $pluginManagerClass();
        $plugins->setServiceLocator($serviceLocator);

        return $plugins;
    }
1215953
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');

        $client = new Client();
        if (!empty($config[$this->configKey])) {

            $clientOptions = $config[$this->configKey];

            if (isset($clientOptions['uri'])) {
                $client->setUri($clientOptions['uri']);
                unset($clientOptions['uri']);
            }

            if (isset($clientOptions['auth'])) {
                $auth = $clientOptions['auth'];
                $client->setAuth(
                    isset($auth['user'])     ? $auth['user']     : '',
                    isset($auth['password']) ? $auth['password'] : '',
                    isset($auth['type'])     ? $auth['type']     : $client::AUTH_BASIC
                );
                unset($clientOptions['auth']);
            }

            $client->setOptions($config[$this->configKey]);
        }

        return $client;
    }
578814
public function createService(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $driver = new $config['ga-goo-gl']['client'];
        $driver->setAdapter($config['ga-goo-gl']['adapter']);
        $driver->setHeaders(array(
            'Content-Type' => 'application/json'
        ));
        $service = new Request();
        $service->setClient($driver);
        return $service;
    }
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;
    }
1230628
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('Config');
        $objectConfig = [];
        if (isset($config['matryoshka']) && isset($config['matryoshka']['object_manager'])) {
            $objectConfig = $config['matryoshka']['object_manager'];
        }
        return new ObjectManager(new Config($objectConfig));
    }
1117276
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /* @var $proxyFactory \ProxyManager\Factory\AccessInterceptorScopeLocalizerFactory */
        $proxyFactory = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptorProxyFactory');
        /* @var $locatorInterceptors \Closure[] */
        $locatorInterceptors = $serviceLocator->get('OcraServiceManager\\ServiceManager\\AccessInterceptors');

        return new ServiceLocatorDelegatorFactory($proxyFactory, $locatorInterceptors);
    }
157696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $context = new RequestContext();
        $context->fromRequest($serviceLocator->get('Request'));

        return $context;
    }
1319332
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new Environment();

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

        return $service;
    }
782535
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /**
         * @var \Zend\ServiceManager\ServiceLocatorAwareTrait $serviceLocator
         */
        $sl = $serviceLocator->getServiceLocator();

        /**
         * @var \Mp3\Form\Search $formSearch
         */
        $formSearch = $sl->get('FormElementManager')
                         ->get('Mp3\Form\Search');

        /**
         * @var \Mp3\Service\Index $serviceIndex
         */
        $serviceIndex = $sl->get('Mp3\Service\Index');

        return new IndexController(
            $formSearch,
            $serviceIndex
        );
    }
1299556
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $workflowServiceManager = $serviceLocator->get(Manager::class);

        /** @var Module $module */
        $module = $serviceLocator->get(Module::class);
        $metadataReaderManager = $module->getMetadataReaderManager();

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

        $metadataReaderName = $moduleOptions->getMetadataReader();
        $metadataReaderOptions = $moduleOptions->getMetadataReaderOptions();
        $metadataReader = $metadataReaderManager->get($metadataReaderName, $metadataReaderOptions, false);

        $options = [
            'serviceManager' => $workflowServiceManager,
            'metadataReader' => $metadataReader
        ];

        return new ServiceTypeResolver($options);
    }