apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -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);
}
}