52 lines
844 B
PHP
52 lines
844 B
PHP
<?php
|
|
|
|
namespace App\Security;
|
|
|
|
use Symfony\Component\Security\Core\User\UserInterface;
|
|
|
|
class User implements UserInterface
|
|
{
|
|
private string $email;
|
|
|
|
/**
|
|
* @var string[]
|
|
*/
|
|
private array $roles = [];
|
|
|
|
public function getEmail(): ?string
|
|
{
|
|
return $this->email;
|
|
}
|
|
|
|
public function setEmail(string $email): static
|
|
{
|
|
$this->email = $email;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUserIdentifier(): string
|
|
{
|
|
return $this->email;
|
|
}
|
|
|
|
public function getRoles(): array
|
|
{
|
|
$roles = $this->roles;
|
|
$roles[] = 'ROLE_USER';
|
|
|
|
return array_unique($roles);
|
|
}
|
|
|
|
public function setRoles(array $roles): static
|
|
{
|
|
$this->roles = $roles;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function eraseCredentials(): void
|
|
{
|
|
}
|
|
}
|