Problème
Après avoir exécuté la commande
symfony console make:user
Vous obtenez l'erreur
Fatal error: Class App\Entity\User contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\Security\Core\User\UserInterface::getUsername)
Solution possible
Pour résoudre ce problème qui se pose avec la version 5.3 de symfony, il faut créer la méthode suivante à la main dans l'entité User
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->email;
}