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

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