Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • unicaen_authentification
  • release_3.1.0
  • 3.x
  • 2.x
  • 4.0.0
  • 3.1.0
  • 2.0.1
  • 3.0.0
  • 2.0.0
  • 1.0.0
11 results

IndexControllerFactory.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    IndexControllerFactory.php 734 B
    <?php
    
    namespace UnicaenDbAnonym\Controller;
    
    use UnicaenDbAnonym\Service\AnonymService;
    use Psr\Container\ContainerInterface;
    
    class IndexControllerFactory
    {
        /**
         * Create service
         *
         * @param ContainerInterface $container
         * @return IndexController
         * @throws \Psr\Container\ContainerExceptionInterface
         * @throws \Psr\Container\NotFoundExceptionInterface
         */
        public function __invoke(ContainerInterface $container): IndexController
        {
            /** @var \UnicaenDbAnonym\Service\AnonymService $service */
            $service = $container->get(AnonymService::class);
    
            $controller = new IndexController();
            $controller->setAnonymService($service);
    
            return $controller;
        }
    }