Skip to content
Snippets Groups Projects
Select Git revision
  • 6.x
  • master default
  • php84
  • 7.x
  • 6.4.0
  • 6.3.3
  • 6.3.2
  • 6.3.1
  • 6.3.0
  • 6.2.3
  • 6.2.2
  • 6.2.1
  • 6.2.0
  • 6.1.0
  • 6.0.9
  • 6.0.8
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 6.0.0
24 results

IndicateurControllerFactory.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    IndicateurControllerFactory.php 1.54 KiB
    <?php
    
    namespace UnicaenIndicateur\Controller;
    
    use Psr\Container\ContainerExceptionInterface;
    use Psr\Container\NotFoundExceptionInterface;
    use UnicaenIndicateur\Form\Indicateur\IndicateurForm;
    use UnicaenIndicateur\Service\Abonnement\AbonnementService;
    use UnicaenIndicateur\Service\Indicateur\IndicateurService;
    use Interop\Container\ContainerInterface;
    use UnicaenUtilisateur\Service\User\UserService;;
    
    class IndicateurControllerFactory {
    
        /**
         * @param ContainerInterface $container
         * @return IndicateurController
         * @throws ContainerExceptionInterface
         * @throws NotFoundExceptionInterface
         */
        public function __invoke(ContainerInterface $container) : IndicateurController
        {
            /**
             * @var AbonnementService $abonnementService
             * @var IndicateurService $indicateurService
             * @var UserService $userService
             */
            $abonnementService = $container->get(AbonnementService::class);
            $indicateurService = $container->get(IndicateurService::class);
            $userService = $container->get(UserService::class);
    
            /**
             * @var IndicateurForm $indicateurForm
             */
            $indicateurForm = $container->get('FormElementManager')->get(IndicateurForm::class);
    
            $controller = new IndicateurController();
            $controller->setAbonnementService($abonnementService);
            $controller->setIndicateurService($indicateurService);
            $controller->setUserService($userService);
            $controller->setIndicateurForm($indicateurForm);
            return $controller;
        }
    }