If we read this doc https://symfony.com/doc/current/security.html#a-create-your-user-class we can see that we have to create a User class which implements UserInterface.