mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -17,11 +17,6 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
use function array_intersect;
|
||||
use function count;
|
||||
use function in_array;
|
||||
|
||||
/**
|
||||
* Voter for Third Party.
|
||||
@@ -66,7 +61,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if ($subject instanceof ThirdParty) {
|
||||
return in_array($attribute, $this->getRoles(), true);
|
||||
return \in_array($attribute, $this->getRoles(), true);
|
||||
}
|
||||
|
||||
if (null === $subject) {
|
||||
@@ -77,7 +72,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @param string $attribute
|
||||
* @param ThirdParty|null $subject
|
||||
*/
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
@@ -94,11 +89,11 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
||||
->getReachableCenters($user, $attribute);
|
||||
|
||||
if (null === $subject) {
|
||||
return count($centers) > 0;
|
||||
return \count($centers) > 0;
|
||||
}
|
||||
|
||||
if ($subject instanceof ThirdParty) {
|
||||
return count(array_intersect($centers, $subject->getCenters()->toArray())) > 0;
|
||||
return \count(\array_intersect($centers, $subject->getCenters()->toArray())) > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user