From: Raphaƫl Gertz Date: Thu, 7 Mar 2024 23:06:04 +0000 (+0100) Subject: Strict types X-Git-Tag: 0.4.0~2 X-Git-Url: https://git.rapsys.eu/userbundle/commitdiff_plain/38bbc6345098782376b9a0d14de901bc7af9cf0b Strict types Document members Cleanup --- diff --git a/Entity/Civility.php b/Entity/Civility.php index d1ccec3..ca2aee1 100644 --- a/Entity/Civility.php +++ b/Entity/Civility.php @@ -22,22 +22,22 @@ use Rapsys\UserBundle\Entity\User; */ class Civility { /** - * @var integer + * Primary key */ - protected int $id; + protected ?int $id = null; /** - * @var \DateTime + * Creation datetime */ protected \DateTime $created; /** - * @var \DateTime + * Update datetime */ protected \DateTime $updated; /** - * @var ArrayCollection + * Users collection */ protected Collection $users; @@ -50,6 +50,8 @@ class Civility { //Set defaults $this->created = new \DateTime('now'); $this->updated = new \DateTime('now'); + + //Set collections $this->users = new ArrayCollection(); } @@ -58,7 +60,7 @@ class Civility { * * @return integer */ - public function getId(): int { + public function getId(): ?int { return $this->id; } diff --git a/Entity/Group.php b/Entity/Group.php index d155002..13b16ef 100644 --- a/Entity/Group.php +++ b/Entity/Group.php @@ -22,22 +22,22 @@ use Rapsys\UserBundle\Entity\User; */ class Group { /** - * @var integer + * Primary key */ - protected int $id; + protected ?int $id = null; /** - * @var \DateTime + * Creation datetime */ protected \DateTime $created; /** - * @var \DateTime + * Update datetime */ protected \DateTime $updated; /** - * @var ArrayCollection + * Users collection */ protected Collection $users; @@ -50,6 +50,8 @@ class Group { //Set defaults $this->created = new \DateTime('now'); $this->updated = new \DateTime('now'); + + //Set collections $this->users = new ArrayCollection(); } @@ -58,7 +60,7 @@ class Group { * * @return integer */ - public function getId(): int { + public function getId(): ?int { return $this->id; } diff --git a/Entity/User.php b/Entity/User.php index 380c7ff..44680fb 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -26,22 +26,22 @@ use Rapsys\UserBundle\Entity\Group; */ class User implements UserInterface, PasswordAuthenticatedUserInterface { /** - * @var ?integer + * Primary key */ - protected ?int $id; + protected ?int $id = null; /** - * @var \DateTime + * Creation datetime */ protected \DateTime $created; /** - * @var \DateTime + * Update datetime */ protected \DateTime $updated; /** - * @var Doctrine\Common\Collections\Collection + * Groups collection */ protected Collection $groups;