Select Git revision
ShibService.php
-
Bertrand Gauthier authored
Shibboleth: l'id mis en session ne peut être le supannEmpId/supannEtuId car le storage Ldap peut trouver un compte correspondant ; prise en compte d'attributs supplémentaires (nom, prénom, civilité)
Bertrand Gauthier authoredShibboleth: l'id mis en session ne peut être le supannEmpId/supannEtuId car le storage Ldap peut trouver un compte correspondant ; prise en compte d'attributs supplémentaires (nom, prénom, civilité)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
DbfakatorServiceFactory.php 1.53 KiB
<?php
namespace UnicaenDbfakator\Service;
use Psr\Container\ContainerInterface;
use Webmozart\Assert\Assert;
class DbfakatorServiceFactory
{
/**
* @param \Psr\Container\ContainerInterface $container
* @return \UnicaenDbfakator\Service\DbfakatorService
* @throws \Doctrine\DBAL\Exception
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): DbfakatorService
{
/** @var \Doctrine\ORM\EntityManager $em */
$em = $container->get('doctrine.entitymanager.orm_default');
$config = $this->getConfig($container);
$service = new DbfakatorService();
$service->setConfig($config);
$service->setEntityManager($em);
return $service;
}
/**
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
private function getConfig(ContainerInterface $container): array
{
/** @var array $appConfig */
$appConfig = $container->get('Config');
$config = $appConfig['unicaen-dbfakator'] ?? [];
if (!$config) {
return [];
}
Assert::isArray($config, "La config du module doit être un tableau");
Assert::keyExists($config, $k = 'entities', "La config du module doit posséder la clé '$k'");
Assert::keyExists($config, $k = 'output', "La config du module doit posséder la clé '$k'");
return $config;
}
}