<?phpnamespaceApp\Security;useApp\Entity\UserasAppUser;useSymfony\Component\Security\Core\Exception\AccountExpiredException;useSymfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;useSymfony\Component\Security\Core\User\UserCheckerInterface;useSymfony\Component\Security\Core\User\UserInterface;classUserCheckerimplementsUserCheckerInterface{publicfunctioncheckPreAuth(UserInterface$user):void{if(!$userinstanceofAppUser){return;}if(!$user->isEnabled()){thrownewCustomUserMessageAuthenticationException('Account is disabled.');}}publicfunctioncheckPostAuth(UserInterface$user):void{if(!$userinstanceofAppUser){return;}}}