Run Rector on your code to see what it can do for you:

 final class DemoFile extends Voter
 {
     public function __construct(
-                private readonly AuthorizationCheckerInterface $authorizationChecker,
+                private readonly \Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface $accessDecisionManager,
 		) {}
     
     protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
     {
-        return $this->authorizationChecker->isGranted('ROLE_ADMIN', $subject);
+        return $this->accessDecisionManager->decide($token, ['ROLE_ADMIN']);
     }
 }
PHP snippet to change

Applied Rules:

Not a change you expect?

Config  rector.php
Rector version: 7be541 - released at 2026-06-30 23:08