From 38bbc6345098782376b9a0d14de901bc7af9cf0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Fri, 8 Mar 2024 00:06:04 +0100 Subject: [PATCH] Strict types Document members Cleanup --- Entity/Civility.php | 14 ++++++++------ Entity/Group.php | 14 ++++++++------ Entity/User.php | 10 +++++----- 3 files changed, 21 insertions(+), 17 deletions(-) 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; -- 2.41.1