Commit 0240732b authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Migration vers laminas

parent d507f84b
Pipeline #11068 passed with stage
in 25 seconds
......@@ -6,8 +6,8 @@ use BjyAuthorize\Service\Authorize;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Event\EventManager;
use UnicaenAuth\Service\UserContext;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Intsancie une chaîne de fournisseurs d'identité.
......
......@@ -7,7 +7,7 @@ use UnicaenApp\Entity\Ldap\People;
use UnicaenApp\HostLocalization\HostLocalizationAwareTrait;
use UnicaenAuth\Entity\Db\AbstractRole;
use UnicaenAuth\Service\Traits\RoleServiceAwareTrait;
use Zend\Ldap\Ldap;
use Laminas\Ldap\Ldap;
use ZfcUser\Entity\UserInterface;
use Traversable;
......@@ -116,7 +116,7 @@ class Db extends AuthenticationIdentityProvider implements ChainableProvider, \B
{
try {
return 1 === $this->getLdap()->count($role->getLdapFilter(), $dn, Ldap::SEARCH_SCOPE_SUB);
} catch (\Zend\Ldap\Exception\LdapException $e) {
} catch (\Laminas\Ldap\Exception\LdapException $e) {
return false;
}
}
......
......@@ -4,9 +4,9 @@ namespace UnicaenAuth\Provider\Identity;
use Interop\Container\ContainerInterface;
use UnicaenApp\Options\ModuleOptions;
use Zend\Ldap\Ldap;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\Ldap\Ldap;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Db identity provider factory
......
......@@ -3,8 +3,8 @@
namespace UnicaenAuth\Provider\Identity;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* LDAP identity provider factory
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Provider\Role;
use BjyAuthorize\Exception\InvalidArgumentException;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Factory responsible of instantiating {@see \UnicaenAuth\Provider\Role\Config}
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Provider\Role;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Service\RoleService;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Factory responsible of instantiating {@see \UnicaenAuth\Provider\Role\DbRole}
......
......@@ -3,7 +3,7 @@
namespace UnicaenAuth\Provider\Role;
use BjyAuthorize\Provider\Role\ProviderInterface;
use Zend\Authentication\AuthenticationService;
use Laminas\Authentication\AuthenticationService;
use ZfcUser\Entity\UserInterface;
use UnicaenAuth\Acl\NamedRole;
......@@ -45,7 +45,7 @@ class Username implements ProviderInterface
}
/**
* @return \Zend\Permissions\Acl\Role\RoleInterface[]
* @return \Laminas\Permissions\Acl\Role\RoleInterface[]
*/
public function getRoles()
{
......
......@@ -3,8 +3,8 @@
namespace UnicaenAuth\Provider\Role;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Description of UsernameServiceFactory
......@@ -30,7 +30,7 @@ class UsernameServiceFactory implements FactoryInterface
$providerConfig = $config['role_providers']['UnicaenAuth\Provider\Role\Username'];
$authService = $container->get('zfcuser_auth_service'); /* @var $authService \Zend\Authentication\AuthenticationService */
$authService = $container->get('zfcuser_auth_service'); /* @var $authService \Laminas\Authentication\AuthenticationService */
return new Username($authService, $providerConfig);
}
......
......@@ -5,7 +5,7 @@ namespace UnicaenAuth\Provider\Rule;
use BjyAuthorize\Provider\Rule\ProviderInterface;
use UnicaenAuth\Provider\Privilege\PrivilegeProviderAwareTrait;
use UnicaenAuth\Provider\Privilege\Privileges;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Rule provider based on a given array of rules
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Service;
use BjyAuthorize\Provider\Identity\ProviderInterface;
use Interop\Container\ContainerInterface;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
/**
* Factory responsible of building the {@see \BjyAuthorize\Service\Authorize} service
......
......@@ -7,8 +7,8 @@ use phpCAS;
use UnicaenApp\Mapper\Ldap\People as LdapPeopleMapper;
use UnicaenApp\Entity\Ldap\People as LdapPeople;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Router\RouteInterface;
use Zend\Router\RouteStackInterface;
use Laminas\Router\RouteInterface;
use Laminas\Router\RouteStackInterface;
use ZfcUser\Authentication\Adapter\ChainableAdapter;
class CasService
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Service;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Entity\Db\Privilege;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
class PrivilegeServiceFactory implements FactoryInterface
{
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Service;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Entity\Db\Role;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
class RoleServiceFactory implements FactoryInterface
{
......
......@@ -9,8 +9,8 @@ use UnicaenApp\Exception\LogicException;
use UnicaenApp\Exception\RuntimeException;
use UnicaenAuth\Entity\Db\AbstractUser;
use UnicaenAuth\Entity\Shibboleth\ShibUser;
use Zend\Router\Http\TreeRouteStack;
use Zend\Session\Container;
use Laminas\Router\Http\TreeRouteStack;
use Laminas\Session\Container;
/**
* Shibboleth service.
......
......@@ -11,17 +11,17 @@ use UnicaenAuth\Entity\Db\AbstractUser;
use UnicaenAuth\Entity\Shibboleth\ShibUser;
use UnicaenAuth\Event\UserAuthenticatedEvent;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Crypt\Password\Bcrypt;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerInterface;
use Zend\Form\Element\Csrf;
use Zend\Form\Element\Password;
use Zend\Form\Element\Submit;
use Zend\Form\Element\Text;
use Zend\Form\Form;
use Zend\InputFilter\Input;
use Zend\Validator\EmailAddress;
use Zend\Validator\Identical;
use Laminas\Crypt\Password\Bcrypt;
use Laminas\EventManager\EventManagerAwareInterface;
use Laminas\EventManager\EventManagerInterface;
use Laminas\Form\Element\Csrf;
use Laminas\Form\Element\Password;
use Laminas\Form\Element\Submit;
use Laminas\Form\Element\Text;
use Laminas\Form\Form;
use Laminas\InputFilter\Input;
use Laminas\Validator\EmailAddress;
use Laminas\Validator\Identical;
use ZfcUser\Entity\UserInterface;
use ZfcUser\Options\ModuleOptions as ZfcUserModuleOptions;
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Service;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Entity\Ldap\People;
use Zend\ServiceManager\InitializerInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\InitializerInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use ZfcUser\Entity\UserInterface;
/**
......@@ -34,12 +34,12 @@ class UserAwareInitializer implements InitializerInterface
public function __invoke(ContainerInterface $container, $instance)
{
// test d'éligibilité à faire au plus tôt pour éviter l'erreur
// 'Circular dependency for LazyServiceLoader was found for instance Zend\Authentication\AuthenticationService'
// 'Circular dependency for LazyServiceLoader was found for instance Laminas\Authentication\AuthenticationService'
if (!$this->canInitialize($instance)) {
return;
}
$authenticationService = $container->get('Zend\Authentication\AuthenticationService');
$authenticationService = $container->get('Laminas\Authentication\AuthenticationService');
if (!$authenticationService->hasIdentity()) {
return;
}
......
......@@ -18,10 +18,10 @@ use UnicaenAuth\Event\UserRoleSelectedEvent;
use UnicaenAuth\Formatter\RoleFormatter;
use UnicaenAuth\Options\Traits\ModuleOptionsAwareTrait;
use UnicaenAuth\Provider\Identity\Chain;
use Zend\Authentication\AuthenticationService;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\EventManager\EventManagerAwareTrait;
use Zend\Permissions\Acl\Role\RoleInterface;
use Laminas\Authentication\AuthenticationService;
use Laminas\EventManager\EventManagerAwareInterface;
use Laminas\EventManager\EventManagerAwareTrait;
use Laminas\Permissions\Acl\Role\RoleInterface;
use ZfcUser\Entity\UserInterface;
/**
......
......@@ -4,7 +4,7 @@ namespace UnicaenAuth\Service;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions;
use Zend\Authentication\AuthenticationService;
use Laminas\Authentication\AuthenticationService;
class UserContextFactory
{
......@@ -15,7 +15,7 @@ class UserContextFactory
public function __invoke(ContainerInterface $container)
{
/** @var AuthenticationService $authenticationService */
$authenticationService = $container->get('Zend\Authentication\AuthenticationService');
$authenticationService = $container->get('Laminas\Authentication\AuthenticationService');
/** @var ModuleOptions $moduleOptions */
$moduleOptions = $container->get('unicaen-auth_module_options');
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuth\Service;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use ZfcUser\Options\ModuleOptions as ZfcUserModuleOptions;
class UserFactory implements FactoryInterface
......
......@@ -5,8 +5,8 @@ namespace UnicaenAuth\Service;
use Doctrine\ORM\EntityManagerInterface;
use Interop\Container\ContainerInterface;
use UnicaenAuth\Options\ModuleOptions;
use Zend\ServiceManager\FactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
class UserMapperFactory implements FactoryInterface
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment