Create and return the MVC controller plugin manager

@param  ServiceLocatorInterface $serviceLocator
@return \Zend\Mvc\Controller\PluginManager
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;
    }
1223596
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /** @var array $config */
        $config = $serviceLocator->get('Config')['eye4web_abac']['assertion_manager'];

        $pluginManager = new AssertionPluginManager(new Config($config));
        $pluginManager->setServiceLocator($serviceLocator);

        return $pluginManager;
    }
483552
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $snippetHelper = new SnippetHelper();

        // Get the top level service locator
        $serviceManager = $serviceLocator;
        if ($serviceManager instanceof HelperPluginManager) {
            $serviceManager = $serviceManager->getServiceLocator();
        }

        if (!$serviceManager->has('Config')) {
            return $snippetHelper;
        }


        $config = $serviceManager->get('Config');

        $snippetsConfig = isset($config[$this->configKey]) ? $config[$this->configKey] : [];

        if (!isset($snippetsConfig['snippets'])) {
            return $snippetHelper;
        }

        $snippets = $snippetsConfig['snippets'];


        if (!is_array($snippets)) {
            return $snippetHelper;
        }

        return $this->configureSnippetHelper($snippetHelper, $config, $snippetsConfig);

    }
461444
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $routeCollection = new RouteCollection();
        $requestContext  = $serviceLocator->get('RouterRequestContext');
        $routerOptions   = array();

        $logger = $serviceLocator->has('logger') ? $serviceLocator->get('Logger') : null;

        $router = new Router($requestContext, $routeCollection, $routerOptions, $logger);

        // @todo - consider making a base router class, and then have a ModuleRouterFactory to pull module routes
        // @todo - find a way to set routes on this after we instantiate this factory

        // @todo - let you add new routes on demand and call $router->setRouteCollection()
        return $router;
    }
298953
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        /**
         * @var array $config
         */
        $config = $serviceLocator->get('config');

        /**
         * @var \Zend\View\HelperPluginManager $serverUrl
         */
        $serverUrl = $serviceLocator->get('ViewHelperManager');

        /**
         * @var \Zend\Mvc\I18n\Translator $translator
         */
        $translator = $serviceLocator->get('translator');

        return new Index(
            $config,
            $serverUrl,
            $translator
        );
    }
1137420
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;

        $acl = $this->serviceLocator->getServiceLocator()
            ->get(Acl::class);

        $identity = $this->getIdentityHelper();

        $role = ($identity()) ? $identity()->getRole() : 'guest';

        $service = new Navigation();
        $service->setAcl($acl);
        $service->setRole($role);

        $service->setServiceLocator($this->serviceLocator->getServiceLocator());

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

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

        return $plugin;
    }
72672
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $resource = new MessageHandler();

        $resource->setFinder($serviceLocator->getServiceLocator()->get(MessageHandlerFinder::class));

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

        /** @var \Zend\Authentication\AuthenticationService $service */
        $service = $serviceLocator->get($options->getAuthenticationService());

        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;
    }
1326494
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $config     = $serviceLocator->get('Config');
        $appRootDir = $config['parameters']['app.root_dir'];

        return new FileLocator($serviceLocator->get('ModuleManager'), $appRootDir);
    }
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;
    }
1250936
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $plugin = new CustomGroups();
        $config = $serviceLocator->getServiceLocator()->get('Config');
        if (isset($config['custom_groups'])) {
            $plugin->setConfig($config['custom_groups']);
        }
        return $plugin;
    }
1125794
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $controller = new IndexController();

        /** @var ControllerManager $serviceLocator */
        $serviceManager = $serviceLocator->getServiceLocator();

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

        /** @var NodeInterface $nodeService */
        $nodeService = $serviceManager->get('KmbPuppetDb\Service\Node');
        $controller->setNodeService($nodeService);

        /** @var Logger $logger */
        $logger = $serviceManager->get('Logger');
        $controller->setLogger($logger);

        return $controller;
    }
471225
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($serviceLocator instanceof ServiceLocatorAwareInterface) {
            $serviceLocator = $serviceLocator->getServiceLocator();
        }

        /** @var \Zend\View\HelperPluginManager $viewHelperManager */
        $viewHelperManager = $serviceLocator->get('ViewHelperManager');
        $postExtractor = new FeedEntry($viewHelperManager->getRenderer());

        return new Writer\Builder($postExtractor, new Mutator);
    }
637696
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $fileTypeAdapters = $serviceLocator->getServiceLocator()->get("prooph.link.fileconnector.file_type_adapter_manager");

        return new FileManagerController($fileTypeAdapters->getAvailableFileTypes());
    }
1264430
public function createService(ServiceManager\ServiceLocatorInterface $serviceLocator)
    {
        $config = $serviceLocator->get('config');

        $config = (isset($config['yima_widgetator'])) ? $config['yima_widgetator'] : [];
        (isset($config['services'])) ? $config = $config['services'] : [];

        // ServiceLocator Will Injected into WidgetManager
        // because is instanceof serviceLocatorAwareInterface
        $smConfig      = new ServiceManager\Config($config);
        $widgetManager = new WidgetManager($smConfig);

        return $widgetManager;
    }