mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -21,10 +21,6 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Description of EventVoter.
|
||||
@@ -90,14 +86,14 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
|
||||
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Event && in_array($attribute, self::ROLES, true))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE], true))
|
||||
return ($subject instanceof Event && \in_array($attribute, self::ROLES, true))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE], true))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @param Event $subject
|
||||
* @param Event $subject
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -121,7 +117,7 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter
|
||||
$centers = $this->authorizationHelper
|
||||
->getReachableCenters($token->getUser(), $attribute);
|
||||
|
||||
return count($centers) > 0;
|
||||
return \count($centers) > 0;
|
||||
|
||||
if (!$this->accessDecisionManager->decide($token, [PersonVoter::SEE], $person)) {
|
||||
return false;
|
||||
|
@@ -21,10 +21,6 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||
{
|
||||
@@ -87,13 +83,13 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
|
||||
public function supports($attribute, $subject)
|
||||
{
|
||||
return ($subject instanceof Participation && in_array($attribute, self::ROLES, true))
|
||||
|| ($subject instanceof Person && in_array($attribute, [self::CREATE, self::SEE], true))
|
||||
return ($subject instanceof Participation && \in_array($attribute, self::ROLES, true))
|
||||
|| ($subject instanceof Person && \in_array($attribute, [self::CREATE, self::SEE], true))
|
||||
|| (null === $subject && self::SEE === $attribute);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @param string $attribute
|
||||
* @param Participation $subject
|
||||
*
|
||||
* @return bool
|
||||
@@ -118,7 +114,7 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar
|
||||
$centers = $this->authorizationHelper
|
||||
->getReachableCenters($token->getUser(), $attribute);
|
||||
|
||||
return count($centers) > 0;
|
||||
return \count($centers) > 0;
|
||||
|
||||
if (!$this->accessDecisionManager->decide($token, [PersonVoter::SEE], $person)) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user