Loading src/UnicaenPrivilege/Controller/AffectationController.php +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ class AffectationController extends AbstractActionController { use RoleServiceAwareTrait; use PrivilegeServiceAwareTrait; public function indexAction() public function indexAction() : ViewModel { $namespaces = $this->getCategorieService()->listerNamespaces(); $namespace = $this->params()->fromQuery('namespace'); Loading @@ -31,7 +31,7 @@ class AffectationController extends AbstractActionController { ]); } public function modifierAction() public function modifierAction() : JsonModel { $privilegeId = $this->params()->fromRoute("privilege"); $roleId = $this->params()->fromRoute("role"); Loading src/UnicaenPrivilege/Controller/CategorieController.php +6 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,8 @@ class CategorieController extends AbstractActionController use CategorieServiceAwareTrait; use CategorieFormAwareTrait; public function indexAction() { public function indexAction() : ViewModel { /** * @var string[] $namespaces * @var string $namespaces Loading Loading @@ -59,7 +60,8 @@ class CategorieController extends AbstractActionController return $vm; } public function gererAction() { public function gererAction() : ViewModel { $categorie = $this->getCategorieService()->getRequestedCategorie($this); return new ViewModel([ Loading @@ -67,7 +69,8 @@ class CategorieController extends AbstractActionController ]); } public function providerAction() { public function providerAction() : ViewModel { $categorie = $this->getCategorieService()->getRequestedCategorie($this); return new ViewModel([ Loading src/UnicaenPrivilege/Guard/PrivilegeController.php +2 −13 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ namespace UnicaenPrivilege\Guard; use BjyAuthorize\Guard\Controller; use Zend\ServiceManager\ServiceLocatorInterface; use UnicaenPrivilege\Provider\Privilege\PrivilegeProviderAwareTrait; use UnicaenApp\Traits\SessionContainerTrait; Loading Loading @@ -31,7 +30,7 @@ class PrivilegeController extends Controller * @param array $rules * @return array */ protected function privilegesToRoles(array $rules) protected function privilegesToRoles(array $rules) : array { $pr = $this->getPrivilegeProvider()->getPrivilegesRoles(); Loading @@ -58,17 +57,7 @@ class PrivilegeController extends Controller return $rules; } /** * Pour récupérer le serviceLocator depuis les traits de service * * @return ServiceLocatorInterface */ protected function getServiceLocator() { return $this->serviceLocator; } public static function getResourceId($controller, $action = null) public static function getResourceId($controller, $action = null) : string { if (isset($action)) { return sprintf('controller/%s:%s', $controller, strtolower($action)); Loading src/UnicaenPrivilege/Guard/PrivilegeControllerFactory.php +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Interop\Container\ContainerInterface; use UnicaenPrivilege\Provider\Privilege\PrivilegeProviderInterface; use UnicaenPrivilege\Service\Privilege\PrivilegeService; class PrivilegeControllerFactory { public function __invoke(ContainerInterface $container) Loading src/UnicaenPrivilege/Guard/PrivilegeRoute.php +7 −22 Original line number Diff line number Diff line Loading @@ -18,19 +18,18 @@ class PrivilegeRoute extends Route use PrivilegeProviderAwareTrait; use SessionContainerTrait; // public function __construct(array $rules, ServiceLocatorInterface $serviceLocator) // { // $this->serviceLocator = $serviceLocator; // // parent::__construct($rules, $serviceLocator); // } public function __construct(array $rules, ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; parent::__construct($rules, $serviceLocator); } public function processConfig() { $this->rules = $this->privilegesToRoles($this->config); } protected function privilegesToRoles(array $rules) protected function privilegesToRoles(array $rules) : array { $pr = $this->getPrivilegeProvider()->getPrivilegesRoles(); Loading @@ -57,21 +56,7 @@ class PrivilegeRoute extends Route return $rules; } /** * Pour récupérer le serviceLocator depuis les traits de service * * @return ServiceLocatorInterface */ protected function getServiceLocator() { return $this->serviceLocator; } public static function getResourceId($route) public static function getResourceId($route) : string { return 'route/'.$route; } Loading Loading
src/UnicaenPrivilege/Controller/AffectationController.php +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ class AffectationController extends AbstractActionController { use RoleServiceAwareTrait; use PrivilegeServiceAwareTrait; public function indexAction() public function indexAction() : ViewModel { $namespaces = $this->getCategorieService()->listerNamespaces(); $namespace = $this->params()->fromQuery('namespace'); Loading @@ -31,7 +31,7 @@ class AffectationController extends AbstractActionController { ]); } public function modifierAction() public function modifierAction() : JsonModel { $privilegeId = $this->params()->fromRoute("privilege"); $roleId = $this->params()->fromRoute("role"); Loading
src/UnicaenPrivilege/Controller/CategorieController.php +6 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,8 @@ class CategorieController extends AbstractActionController use CategorieServiceAwareTrait; use CategorieFormAwareTrait; public function indexAction() { public function indexAction() : ViewModel { /** * @var string[] $namespaces * @var string $namespaces Loading Loading @@ -59,7 +60,8 @@ class CategorieController extends AbstractActionController return $vm; } public function gererAction() { public function gererAction() : ViewModel { $categorie = $this->getCategorieService()->getRequestedCategorie($this); return new ViewModel([ Loading @@ -67,7 +69,8 @@ class CategorieController extends AbstractActionController ]); } public function providerAction() { public function providerAction() : ViewModel { $categorie = $this->getCategorieService()->getRequestedCategorie($this); return new ViewModel([ Loading
src/UnicaenPrivilege/Guard/PrivilegeController.php +2 −13 Original line number Diff line number Diff line Loading @@ -3,7 +3,6 @@ namespace UnicaenPrivilege\Guard; use BjyAuthorize\Guard\Controller; use Zend\ServiceManager\ServiceLocatorInterface; use UnicaenPrivilege\Provider\Privilege\PrivilegeProviderAwareTrait; use UnicaenApp\Traits\SessionContainerTrait; Loading Loading @@ -31,7 +30,7 @@ class PrivilegeController extends Controller * @param array $rules * @return array */ protected function privilegesToRoles(array $rules) protected function privilegesToRoles(array $rules) : array { $pr = $this->getPrivilegeProvider()->getPrivilegesRoles(); Loading @@ -58,17 +57,7 @@ class PrivilegeController extends Controller return $rules; } /** * Pour récupérer le serviceLocator depuis les traits de service * * @return ServiceLocatorInterface */ protected function getServiceLocator() { return $this->serviceLocator; } public static function getResourceId($controller, $action = null) public static function getResourceId($controller, $action = null) : string { if (isset($action)) { return sprintf('controller/%s:%s', $controller, strtolower($action)); Loading
src/UnicaenPrivilege/Guard/PrivilegeControllerFactory.php +0 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ use Interop\Container\ContainerInterface; use UnicaenPrivilege\Provider\Privilege\PrivilegeProviderInterface; use UnicaenPrivilege\Service\Privilege\PrivilegeService; class PrivilegeControllerFactory { public function __invoke(ContainerInterface $container) Loading
src/UnicaenPrivilege/Guard/PrivilegeRoute.php +7 −22 Original line number Diff line number Diff line Loading @@ -18,19 +18,18 @@ class PrivilegeRoute extends Route use PrivilegeProviderAwareTrait; use SessionContainerTrait; // public function __construct(array $rules, ServiceLocatorInterface $serviceLocator) // { // $this->serviceLocator = $serviceLocator; // // parent::__construct($rules, $serviceLocator); // } public function __construct(array $rules, ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; parent::__construct($rules, $serviceLocator); } public function processConfig() { $this->rules = $this->privilegesToRoles($this->config); } protected function privilegesToRoles(array $rules) protected function privilegesToRoles(array $rules) : array { $pr = $this->getPrivilegeProvider()->getPrivilegesRoles(); Loading @@ -57,21 +56,7 @@ class PrivilegeRoute extends Route return $rules; } /** * Pour récupérer le serviceLocator depuis les traits de service * * @return ServiceLocatorInterface */ protected function getServiceLocator() { return $this->serviceLocator; } public static function getResourceId($route) public static function getResourceId($route) : string { return 'route/'.$route; } Loading