From 1c80820783e46938fbf68b3aacd369a9ce7ebc1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Thu, 29 Feb 2024 14:56:42 +0100 Subject: [PATCH] Php 8.x constructor style Match parent user entity constructor Cleanup --- Entity/User.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Entity/User.php b/Entity/User.php index 807fece..4b3d4e3 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -14,6 +14,7 @@ namespace Rapsys\AirBundle\Entity; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\ArrayCollection; +use Rapsys\UserBundle\Entity\Civility; use Rapsys\UserBundle\Entity\User as BaseUser; class User extends BaseUser { @@ -81,10 +82,16 @@ class User extends BaseUser { * Constructor * * @param string $mail The user mail - */ - public function __construct(string $mail) { + * @param string $password The user password + * @param ?Civility $civility The user civility + * @param ?string $forename The user forename + * @param ?string $surname The user surname + * @param bool $active The user active + * @param bool $enable The user enable + */ + public function __construct(protected string $mail, protected string $password, protected ?Civility $civility = null, protected ?string $forename = null, protected ?string $surname = null, protected bool $active = false, protected bool $enable = true) { //Call parent constructor - parent::__construct($mail); + parent::__construct($this->mail, $this->password, $this->civility, $this->forename, $this->surname, $this->active, $this->enable); //Set defaults $this->city = null; -- 2.41.0