thomas-claireau/PHP-P6-Openclassrooms

View on GitHub
src/Controller/Security/UserChecker.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace App\Controller\Security;

use App\Entity\User;
use App\Exception\AccountDeletedException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\Exception\AccountExpiredException;
use Symfony\Component\Security\Core\Exception\DisabledException;

class UserChecker implements UserCheckerInterface
{
    public function checkPreAuth(UserInterface $user)
    {
        if (!$user->getActif()) {
            throw new DisabledException('...');
        }
    }

    public function checkPostAuth(UserInterface $user)
    {
    }
}