1818#[ORM \Entity(repositoryClass: UserRepository::class)]
1919#[ORM \Table(name: '`user` ' )]
2020#[ORM \HasLifecycleCallbacks]
21- class User implements \Stringable, UserInterface, PasswordAuthenticatedUserInterface
21+ final class User implements \Stringable, UserInterface, PasswordAuthenticatedUserInterface
2222{
2323 final public const string ROLE_USER = 'ROLE_USER ' ;
2424
@@ -61,6 +61,7 @@ public function getId(): int
6161 return $ this ->id ;
6262 }
6363
64+ #[\Override]
6465 public function __toString (): string
6566 {
6667 return $ this ->getUserIdentifier ().' ( ' .$ this ->getId ().') ' ;
@@ -82,6 +83,7 @@ public function __unserialize(array $data): void
8283 [$ this ->id , $ this ->username , $ this ->password , $ this ->email ] = $ data ;
8384 }
8485
86+ #[\Override]
8587 public function getUserIdentifier (): string
8688 {
8789 if ($ this ->username === '' ) {
@@ -94,6 +96,7 @@ public function getUserIdentifier(): string
9496 /**
9597 * Returns the roles or permissions granted to the user for security.
9698 */
99+ #[\Override]
97100 public function getRoles (): array
98101 {
99102 return [self ::ROLE_USER ];
@@ -114,6 +117,7 @@ public function setEmail(string $email): self
114117 return $ this ;
115118 }
116119
120+ #[\Override]
117121 public function getPassword (): string
118122 {
119123 return $ this ->password ;
0 commit comments