Change $this->authorizationChecker->isGranted([$a, $b])
to $this->authorizationChecker->isGranted($a) || $this->authorizationChecker->isGranted($b)
, also updates AbstractController usages
-if ($this->authorizationChecker->isGranted(['ROLE_USER', 'ROLE_ADMIN'])) {
+if ($this->authorizationChecker->isGranted('ROLE_USER') || $this->authorizationChecker->isGranted('ROLE_ADMIN')) {
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Symfony44\Rector\MethodCall\AuthorizationCheckerIsGrantedExtractorRector;
return RectorConfig::configure()
->withRules([
AuthorizationCheckerIsGrantedExtractorRector::class,
]);