@param SerializerInterface $jmsSerializer

@return EntryPoint
13834
public function addDefaultDeserializers(SerializerInterface $jmsSerializer): EntryPoint
    {
        $this->addDeserializer(new ArticleHandler($jmsSerializer));
        $this->addDeserializer(new OrderHandler($jmsSerializer));
        $this->addDeserializer(new CategoryHandler($jmsSerializer));
        $this->addDeserializer(new MediaHandler($jmsSerializer));
        $this->addDeserializer(new ManufacturerHandler($jmsSerializer));

        return $this;
    }
343332
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /**
         * @var array                              $config
         * @var \RouteGuard\Service\InstanceLoader $loader
         */
        $config      = $serviceLocator->get('config');
        $guardConfig = isset($config['guards']) ? $config['guards'] : [];
        $loader      = $serviceLocator->get('RouteGuard\Service\InstanceLoader');
        $service     = new RouteGuard($guardConfig, $loader);

        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
        );
    }
1166811
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var HelperPluginManager $serviceLocator */
        $mainServiceManager = $serviceLocator->getServiceLocator();

        $helper = new EnvironmentSelect();

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

        /** @var Application $application */
        $application = $mainServiceManager->get('Application');
        $helper->setRouteMatch($application->getMvcEvent()->getRouteMatch());

        return $helper;
    }
498490
public static function device(
        Authorization $authorization,
        ClientInterface $client = null,
        SerializerInterface $serializer = null
    ) {
        AnnotationRegistry::registerLoader('class_exists');

        $afterpayClient = $client ?: new Client([ 'base_uri' => $authorization->getEndpoint() ]);
        $afterpaySerializer = $serializer ?: SerializerFactory::getSerializer();

        return new Service\InStore\Device($authorization, $afterpayClient, $afterpaySerializer);
    }
858066
public function setSerializer($serializer)
    {
        if (!$serializer instanceof AnDomainSerializerAbstract) {
            if (is_string($serializer) && strpos($serializer, '.') === false) {
                $identifier = clone $this->_repository->getIdentifier();
                $identifier->path = array('domain','serializer');
                $identifier->name = $serializer;
                register_default(array(
                    'identifier' => $identifier, 
                    'prefix' => $this->_repository->getClone()
                ));
            } else {
                $identifier = $this->getIdentifier($serializer);
            }

            $serializer = $identifier;
        }

        $this->_serializer = $serializer;
    }
560875
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var Manager $workflowServiceManager */
        $workflowServiceManager = $serviceLocator->get(Manager::class);
        $chainResolver = $serviceLocator->get(ChainTypeResolver::class);
        $serviceResolver = $serviceLocator->get(ServiceTypeResolver::class);

        $options = [
            InjectTypeResolver::WORKFLOW_SERVICE_MANAGER => $workflowServiceManager,
            InjectTypeResolver::CHAIN_TYPE_RESOLVER => $chainResolver,
            InjectTypeResolver::SERVICE_TYPE_RESOLVER => $serviceResolver
        ];

        return new InjectTypeResolver($options);
    }
1307839
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var EntityManagerInterface $objectManager */
        $objectManager = $serviceLocator->get('Doctrine\ORM\EntityManager');

        /** @var ValidatorPluginManager $validatorPluginManager */
        $validatorPluginManager = $serviceLocator->get('ValidatorManager');

        return new DoctrineORMProvider($objectManager, $validatorPluginManager);
    }
676698
protected function serializeResource(FractalSerializerAbstract $serializer, $data)
    {
        $resourceKey = $this->resource->getResourceKey();

        if ($this->resource instanceof FractalCollection) {
            return $serializer->collection($resourceKey, $data);
        } elseif ($this->resource instanceof FractalItem) {
            return $serializer->item($resourceKey, $data);
        } elseif ($this->resource instanceof NodesResourceContent) {
            return (! empty($resourceKey)) ? [$resourceKey => $data] : $data;
        }

        return $serializer->null();
    }
267885
public function createService(ServiceLocatorInterface $serviceManager)
    {
        /** @var \Doctrine\ORM\EntityManager $objectManager */
        $objectManager = $serviceManager->get('Doctrine\ORM\EntityManager');

        /** @var \Eye4web\Zf2Board\Options\ModuleOptionsInterface $options */
        $options = $serviceManager->get('Eye4web\Zf2Board\Options\ModuleOptions');

        /** @var \Eye4web\Zf2Board\Service\SlugServiceInterface $slugService */
        $slugService = $serviceManager->get('Eye4web\Zf2Board\Service\SlugService');

        $mapper = new TopicMapper($objectManager, $slugService, $options);

        return $mapper;
    }
656739
public function injectObjectManager(ObjectManagerInterface $objectManager)
    {
        $this->objectManager = $objectManager;
        /** @var CacheManager $cacheManager */
        $cacheManager = $this->objectManager->get(CacheManager::class);
        $this->methodPermissionCache = $cacheManager->getCache('Flow_Security_Authorization_Privilege_Method');
        $this->runtimeExpressionEvaluator = $this->objectManager->get(RuntimeExpressionEvaluator::class);
    }
1123189
protected function newSerializer(ResourceConfiguration $config)
    {
        return new JMSSerializer(
            SerializerBuilder::create()->build(),
            new SerializationContext,
            new JMSPropertyExcluder($config->getExcludedProperties())
        );
    }
1048529
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /* @var $options FormAnnotationBuilder */
        $options = $serviceLocator->get(FormAnnotationBuilder::class);

        $cache = $serviceLocator->has($options->getCache())
            ? $serviceLocator->get($options->getCache())
            : null;

        $builder = new AnnotationBuilder($cache);

        if ($serviceLocator->has('FormElementManager')) {
            $serviceLocator->get('FormElementManager')->injectFactory($builder);
        }

        foreach ($options->getAnnotations() as $annotation) {
            $builder->getAnnotationParser()->registerAnnotation($annotation);
        }

        $events = $builder->getEventManager();
        foreach ($options->getListeners() as $listener) {
            $listener = $serviceLocator->has($listener)
                ? $serviceLocator->get($listener)
                : new $listener();

            if (!$listener instanceof ListenerAggregateInterface) {
                throw new RuntimeException(sprintf(
                    'Invalid event listener (%s) provided',
                    get_class($listener)
                ));
            }

            $events->attach($listener);
        }

        if (null !== $options->getPreserveDefinedOrder()) {
            $builder->setPreserveDefinedOrder($options->getPreserveDefinedOrder());
        }

        return $builder;
    }
1154900
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new LogCollector();

        /** @var LogRepositoryInterface $logRepository */
        $logRepository = $serviceLocator->get('LogRepository');
        $service->setLogRepository($logRepository);

        return $service;
    }
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));
    }
439696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');
        $config = new GuardLoaderConfig($config['guard']['instance_loader']);
        $loader = new InstanceLoader($config);

        return $loader;
    }
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);
    }