Commit ad67cc75 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Retrait des injections automatiques dans les controllers (A->I)

parent 6bf1cf51
Loading
Loading
Loading
Loading
+1 −4
Changes for module/Application/src/Application/Controller/DoctorantController.php: 1 added line, 4 removed lines.
Original line number Diff line number Diff line
@@ -6,9 +6,7 @@ use Application\Entity\Db\Doctorant;
use Application\Entity\Db\Variable;
use Application\Filter\DbExceptionFormatter;
use Application\RouteMatch;
use Application\Service\Doctorant\DoctorantServiceAwareInterface;
use Application\Service\Doctorant\DoctorantServiceAwareTrait;
use Application\Service\Variable\VariableServiceAwareInterface;
use Application\Service\Variable\VariableServiceAwareTrait;
use Doctrine\DBAL\DBALException;
use UnicaenAuth\Authentication\Adapter\Ldap as LdapAuthAdapter;
@@ -17,8 +15,7 @@ use Zend\InputFilter\Factory;
use Zend\Stdlib\ParametersInterface;
use Zend\View\Model\ViewModel;

class DoctorantController extends AbstractController implements
    VariableServiceAwareInterface, DoctorantServiceAwareInterface
class DoctorantController extends AbstractController
{
    use VariableServiceAwareTrait;
    use DoctorantServiceAwareTrait;
+0 −5
Changes for module/Application/src/Application/Controller/EcoleDoctoraleController.php: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -7,19 +7,14 @@ use Application\Entity\Db\IndividuRole;
use Application\Entity\Db\Role;
use Application\Form\EcoleDoctoraleForm;
use Application\RouteMatch;
use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareInterface;
use Application\Service\EcoleDoctorale\EcoleDoctoraleServiceAwareTrait;
use Application\Service\Individu\IndividuServiceAwareInterface;
use Application\Service\Individu\IndividuServiceAwareTrait;
use Application\Service\Role\RoleServiceAwareInterface;
use Application\Service\Role\RoleServiceAwareTrait;
use UnicaenLdap\Entity\People;
use UnicaenLdap\Service\LdapPeopleServiceAwareInterface;
use UnicaenLdap\Service\LdapPeopleServiceAwareTrait;
use Zend\View\Model\ViewModel;

class EcoleDoctoraleController extends AbstractController
    implements EcoleDoctoraleServiceAwareInterface, LdapPeopleServiceAwareInterface, IndividuServiceAwareInterface, RoleServiceAwareInterface
{
    use EcoleDoctoraleServiceAwareTrait;
    use LdapPeopleServiceAwareTrait;
+1 −5
Changes for module/Application/src/Application/Controller/EtablissementController.php: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -6,14 +6,10 @@ use Application\Entity\Db\Etablissement;
use Application\Entity\Db\IndividuRole;
use Application\Entity\Db\Role;
use Application\Form\EtablissementForm;
use Application\Service\Etablissement\EtablissementServiceAwareInterface;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
use Application\Service\Individu\IndividuServiceAwareInterface;
use Application\Service\Individu\IndividuServiceAwareTrait;
use Application\Service\Role\RoleServiceAwareInterface;
use Application\Service\Role\RoleServiceAwareTrait;
use UnicaenLdap\Entity\People;
use UnicaenLdap\Service\LdapPeopleServiceAwareInterface;
use UnicaenLdap\Service\LdapPeopleServiceAwareTrait;
use Zend\View\Model\ViewModel;

@@ -22,7 +18,7 @@ use Zend\View\Model\ViewModel;
 * @package Application\Controller
 */
class EtablissementController extends AbstractController
    implements EtablissementServiceAwareInterface, LdapPeopleServiceAwareInterface, IndividuServiceAwareInterface, RoleServiceAwareInterface

{
    use EtablissementServiceAwareTrait;
    use LdapPeopleServiceAwareTrait;
+1 −1
Changes for module/Application/src/Application/Controller/ExportController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ use Application\Service\These\TheseServiceAwareTrait;
use Application\View\Helper\Sortable;
use UnicaenApp\View\Model\CsvModel;

class ExportController extends AbstractController implements TheseServiceAwareInterface, FichierServiceAwareInterface
class ExportController extends AbstractController
{
    use TheseServiceAwareTrait;
    use FichierServiceAwareTrait;
+33 −0
Changes for module/Application/src/Application/Controller/Factory/DoctorantControllerFactory.php: 33 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Application\Controller\Factory;

use Application\Controller\DoctorantController;
use Application\Service\Doctorant\DoctorantService;
use Application\Service\Variable\VariableService;
use Zend\Mvc\Controller\ControllerManager;

class DoctorantControllerFactory
{
    /**
     * Create service
     *
     * @param ControllerManager $controllerManager
     * @return DoctorantController
     */
    public function __invoke(ControllerManager $controllerManager)
    {
        /**
         * @var VariableService $variableService
         * @var DoctorantService $doctorantService
         */
        $variableService = $controllerManager->getServiceLocator()->get('VariableService');
        $doctorantService = $controllerManager->getServiceLocator()->get('DoctorantService');

        $controller = new DoctorantController();
        $controller->setVariableService($variableService);
        $controller->setDoctorantService($doctorantService);

        return $controller;
    }
}
Loading