Skip to content
Snippets Groups Projects
Commit 5629c45d authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Remplacement par des Factories des closures qui posent problème avec le cache...

Remplacement par des Factories des closures qui posent problème avec le cache de config de Zend s'il est activé
parent 6d5a21cc
No related branches found
No related tags found
No related merge requests found
......@@ -92,12 +92,7 @@ return [
'controller_plugins' => [
'factories' => [
'isAllowed' => function (ContainerInterface $container) {
/* @var $authorize \BjyAuthorize\Service\Authorize */
$authorize = $container->get('BjyAuthorize\Service\Authorize');
return new BjyAuthorize\Controller\Plugin\IsAllowed($authorize);
}
'isAllowed' => \BjyAuthorize\Controller\Plugin\IsAllowedFactory::class,
],
],
......@@ -111,12 +106,7 @@ return [
'view_helpers' => [
'factories' => [
'isAllowed' => function (ContainerInterface $container) {
/* @var $authorize \BjyAuthorize\Service\Authorize */
$authorize = $container->get('BjyAuthorize\Service\Authorize');
return new \BjyAuthorize\View\Helper\IsAllowed($authorize);
}
'isAllowed' => \BjyAuthorize\View\Helper\IsAllowedFactory::class,
],
],
......
<?php
namespace BjyAuthorize\Controller\Plugin;
use Interop\Container\ContainerInterface;
class IsAllowedFactory
{
/**
*
* @param ContainerInterface $container
*
* @return IsAllowed
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* @var $authorize \BjyAuthorize\Service\Authorize */
$authorize = $container->get('BjyAuthorize\Service\Authorize');
return new IsAllowed($authorize);
}
}
\ No newline at end of file
<?php
namespace BjyAuthorize\View\Helper;
use Interop\Container\ContainerInterface;
class IsAllowedFactory
{
/**
*
* @param ContainerInterface $container
*
* @return IsAllowed
*/
public function __invoke(ContainerInterface $container, $requestedName, $options = null)
{
/* @var $authorize \BjyAuthorize\Service\Authorize */
$authorize = $container->get('BjyAuthorize\Service\Authorize');
return new IsAllowed($authorize);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment