mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-29 18:14:59 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -15,9 +15,6 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
|
||||
|
||||
use function array_keys;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Helper which traverse all role to find parents.
|
||||
*/
|
||||
@@ -50,12 +47,12 @@ class ParentRoleHelper
|
||||
{
|
||||
$parentRoles = [$role];
|
||||
// transform the roles from role hierarchy from string to Role
|
||||
$roles = array_keys($this->hierarchy);
|
||||
$roles = \array_keys($this->hierarchy);
|
||||
|
||||
foreach ($roles as $r) {
|
||||
$childRoles = $this->roleHierarchy->getReachableRoleNames([$r]);
|
||||
|
||||
if (in_array($role, $childRoles, true)) {
|
||||
if (\in_array($role, $childRoles, true)) {
|
||||
$parentRoles[] = $r;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +63,7 @@ class ParentRoleHelper
|
||||
/**
|
||||
* Test if a parent role may give access to a given child role.
|
||||
*
|
||||
* @param string $childRole The role we want to test if he is reachable
|
||||
* @param string $childRole The role we want to test if he is reachable
|
||||
* @param string $parentRole The role which should give access to $childRole
|
||||
*
|
||||
* @return bool true if the child role is granted by parent role
|
||||
@@ -76,6 +73,6 @@ class ParentRoleHelper
|
||||
$reachableRoles = $this->roleHierarchy
|
||||
->getReachableRoleNames([$parentRole]);
|
||||
|
||||
return in_array($childRole, $reachableRoles, true);
|
||||
return \in_array($childRole, $reachableRoles, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user