]> Raphaël G. Git Repositories - userbundle/commitdiff
Strict types
authorRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 23:06:04 +0000 (00:06 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 7 Mar 2024 23:06:04 +0000 (00:06 +0100)
Document members
Cleanup

Entity/Civility.php
Entity/Group.php
Entity/User.php

index d1ccec37fe9b787d62f7337b65d2ed34cf254c21..ca2aee12e4486558a9d375c95395dcb9965adf3a 100644 (file)
@@ -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;
        }
 
index d1550026cbdfc986c58f7b2066b333ec46b05fcc..13b16ef821049e9bcfa41682b038911d33cd2b7a 100644 (file)
@@ -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;
        }
 
index 380c7ffa1660b83a53fdbd9ab3ed88e65c1d4670..44680fb360729496577dce4fa4860498090a0093 100644 (file)
@@ -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;