Find the best Rector rule to solve your problem. Searching through 675 rules.
Found 1 rule. That's the one:
Change $this->authorizationChecker->isGranted([$a, $b])
to $this->authorizationChecker->isGranted($a) || $this->authorizationChecker->isGranted($b)
, also updates AbstractController usages
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
final class SomeController
{
public function __construct(
private AuthorizationCheckerInterface $authorizationChecker
) {
}
public function hasAccess(): bool
{
- if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
+ if ($this->authorizationChecker->isGranted('ROLE_USER') || $this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return true;
}
return false;
}
}