{@inheritdoc}
@see \Zend\ServiceManager\FactoryInterface::createService()
760604
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof AbstractPluginManager) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

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

        return $plugin;
    }
1168040
public function create(): Service
    {
        /** @var Endpoint $data */
        $data = $this;

        /** @var Service $service */
        $service = Service::post($data, ["clientId" => $this->clientId]);

        return $service;
    }
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);
    }
566337
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceLocator = $serviceLocator->getServiceLocator();
        $helper = new GlobalMessenger();
        $controllerPluginManager = $serviceLocator->get('ControllerPluginManager');
        $globalMessenger = $controllerPluginManager->get('globalMessenger');
        $helper->setPluginGlobalMessenger($globalMessenger);
        $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']);
            }
        }

        return $helper;
    }
113556
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new ReportStatistics();
        /** @var Report $reportService */
        $reportService = $serviceLocator->get('KmbPuppetDb\Service\Report');
        $service->setReportService($reportService);
        return $service;
    }
464956
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $serviceLocator = $serviceLocator->getServiceLocator();
        $helper = new FormMessages();
        $config = $serviceLocator->get('Config');
        if (isset($config['view_helper_config']['formmessages'])) {
            $configHelper = $config['view_helper_config']['formmessages'];
            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;
    }
1142248
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config')['mongoObjectMapper'];
        $client = self::constructMongoClient(@$config['uri'], @$config['options']);

        $mapperClass = 'MongoObject\Mapper';
        if (isset($config['mapperClass'])) {
            $mapperClass = $config['mapperClass'];
        }

        return new $mapperClass($client->selectDb($config['database']), @$config['modelsNamespace']);
    }
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;
    }
329032
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof AbstractPluginManager) {
            $serviceLocator = $serviceLocator->getServiceLocator() ?: $serviceLocator;
        }

        return $this->create($serviceLocator);
    }
1099129
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /* @var $eventManager \Zend\EventManager\EventManagerInterface */
        $eventManager     = $serviceLocator->get('OcraServiceManager\\ServiceManager\\EventManager');
        $creationListener = $this->createInstantiationListener($eventManager);

        return array(
            'create' => $creationListener,
            'get'    => $creationListener,
        );
    }
955666
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof ServiceLocatorAwareInterface) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }
        /** @var ServiceLocatorInterface $domainManager */
        $domainManager = $serviceLocator->get('MamuzBlog\DomainManager');

        /** @var \MamuzBlog\Crypt\AdapterInterface $cryptEngine */
        $cryptEngine = $domainManager->get('MamuzBlog\Crypt\HashIdAdapter');

        return new HashId($cryptEngine);
    }
442536
public function createService(ServiceLocatorInterface $serviceManager)
    {
        $serviceLocator = $serviceManager->getServiceLocator();

        return $this->__invoke($serviceLocator, null);
    }
288422
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $appConfig = $serviceLocator->get('config');
        $config = array_key_exists('log', $appConfig) ? $appConfig['log'] : array();
        $class = array_key_exists('class', $config) ? $config['class'] : 'Zend\Log\Logger';
        $logger = new $class($config);
        return $logger;
    }
353376
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $pluginManagerClass = static::PLUGIN_MANAGER_CLASS;
        $plugins = new $pluginManagerClass;
        $plugins->setServiceLocator($serviceLocator);
        $configuration    = $serviceLocator->get('Config');

        if (isset($configuration['di']) && $serviceLocator->has('Di')) {
            $di = $serviceLocator->get('Di');
            $plugins->addAbstractFactory(
                new DiAbstractServiceFactory($di, DiAbstractServiceFactory::USE_SL_BEFORE_DI)
            );
        }

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

        /** @var ObjectManagerAutoDetectorInterface $objectManagerAutoDetector */
        $objectManagerAutoDetector = $appServiceLocator->get(ObjectManagerAutoDetectorInterface::class);

        /** @var DoctrineObjectManagerInterface $objectManager */
        $objectManager = $appServiceLocator->get(DoctrineObjectManagerInterface::class);


        return new DoctrineObjectHydratorLocator($objectManagerAutoDetector, $objectManager);
    }
165175
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $plugins = parent::createService($serviceLocator);

        // override translate view helper, if translator is created by service locator
        if ($serviceLocator->has('Translator')) {
            $plugins->setFactory('translate', function($sm) use ($serviceLocator) {
                $translateViewHelper = new \Zend_View_Helper_Translate($serviceLocator->get('Translator'));
                return $translateViewHelper;
            });
        }

        if ($serviceLocator->has('Navigation')) {
            $plugins->setFactory('navigation', function($sm) use ($serviceLocator) {
                $navigationViewHelper = new \HumusMvc\View\Helper\Navigation();
                $navigationViewHelper->setServiceLocator($serviceLocator);
                return $navigationViewHelper;
            });
        }

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

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


        $creationOptions = $this->getCreationOptions();
        $options = is_array($creationOptions) ? $creationOptions : [];

        $contextMap = array_key_exists('contextMap', $options) ? $options['contextMap'] : [];

        $className = array_key_exists('className', $options) ? (string)$options['className'] : static::$defaultTargetClassName;

        $r = new ReflectionClass($className);
        $resolverByModuleContextMap = $r->newInstance($moduleOptionsPluginManager);

        if (!$resolverByModuleContextMap instanceof static::$defaultTargetClassName) {
            $errMsg = sprintf('ResolverByModuleContextMap not implements: %s', static::$defaultTargetClassName);
            throw new Exception\RuntimeException($errMsg);
        }

        $resolverByModuleContextMap->setContextMap($contextMap);

        return $resolverByModuleContextMap;
    }