added type annotations
This commit is contained in:
parent
2aeeb0d87e
commit
8794806e2c
|
@ -3,11 +3,11 @@
|
|||
namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Stringable;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
@ -15,7 +15,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class), ORM\HasLifecycleCallbacks]
|
||||
#[UniqueEntity(fields: ['username', 'email'], message: 'There is already an account with this username or email.')]
|
||||
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
|
@ -45,22 +44,22 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
private ?string $lastName = '';
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Projects::class, mappedBy: 'developer')]
|
||||
private $projects;
|
||||
private Collection $projects;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private string $avatar;
|
||||
private ?string $avatar;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Pages::class)]
|
||||
private $pages;
|
||||
private Collection $pages;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable')]
|
||||
private $createdAt;
|
||||
private DateTimeImmutable $createdAt;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
|
||||
private $modifiedAt;
|
||||
private DateTimeImmutable $modifiedAt;
|
||||
|
||||
#[ORM\Column(type: 'boolean')]
|
||||
private $isVerified = false;
|
||||
private bool $isVerified = false;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?DateTimeImmutable $agreedTermsAt = null;
|
||||
|
@ -137,13 +136,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function eraseCredentials()
|
||||
{
|
||||
$this->plainPassword = '';
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
|
@ -157,10 +149,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setPlainPassword(string $plainPassword): void
|
||||
{
|
||||
$this->plainPassword = $plainPassword;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
|
@ -279,13 +267,13 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUri()
|
||||
{
|
||||
return 'avatar';
|
||||
}
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUri(): string
|
||||
{
|
||||
return 'avatar';
|
||||
}
|
||||
|
||||
#[ORM\PrePersist]
|
||||
public function onPrePersist(): void
|
||||
|
@ -322,4 +310,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function eraseCredentials()
|
||||
{
|
||||
// TODO: Implement eraseCredentials() method.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue