From fff9fb961cc1dc52604390ab9aae2053aae1ce1c Mon Sep 17 00:00:00 2001 From: Bertrand Gauthier <bertrand.gauthier@unicaen.fr> Date: Wed, 30 Aug 2017 07:54:46 +0000 Subject: [PATCH] =?UTF-8?q?Abandon=20de=20l'interface=20ServiceLocatorAwar?= =?UTF-8?q?eInterface=20d=C3=A9pr=C3=A9ci=C3=A9e.=20Remplac=C3=A9e=20par?= =?UTF-8?q?=20une=20injection=20de=20d=C3=A9pendance=20dans=20la=20factory?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UnicaenOauth/Cas/CasService.php | 5 ++--- src/UnicaenOauth/Cas/CasServiceFactory.php | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/UnicaenOauth/Cas/CasService.php b/src/UnicaenOauth/Cas/CasService.php index b1a17c4..3c17b8b 100644 --- a/src/UnicaenOauth/Cas/CasService.php +++ b/src/UnicaenOauth/Cas/CasService.php @@ -1,11 +1,10 @@ <?php namespace UnicaenOauth\Cas; -use Zend\ServiceManager\ServiceLocatorAwareInterface; -use Zend\ServiceManager\ServiceLocatorAwareTrait; use phpCAS; +use Zend\ServiceManager\ServiceLocatorAwareTrait; -class CasService implements ServiceLocatorAwareInterface +class CasService { use ServiceLocatorAwareTrait; diff --git a/src/UnicaenOauth/Cas/CasServiceFactory.php b/src/UnicaenOauth/Cas/CasServiceFactory.php index 58d4859..6d04852 100644 --- a/src/UnicaenOauth/Cas/CasServiceFactory.php +++ b/src/UnicaenOauth/Cas/CasServiceFactory.php @@ -11,6 +11,9 @@ class CasServiceFactory implements FactoryInterface { $config = $serviceLocator->get('config'); - return new CasService($config['unicaen-oauth']['cas']); + $service = new CasService($config['unicaen-oauth']['cas']); + $service->setServiceLocator($serviceLocator); + + return $service; } } \ No newline at end of file -- GitLab