diff --git a/Models/NullProfile.php b/Models/NullProfile.php index 8531373..aee6e77 100644 --- a/Models/NullProfile.php +++ b/Models/NullProfile.php @@ -34,5 +34,6 @@ final class NullProfile extends Profile public function __construct(int $id = 0) { $this->id = $id; + parent::__construct(); } } diff --git a/Models/Profile.php b/Models/Profile.php index 074fb0e..5e98655 100644 --- a/Models/Profile.php +++ b/Models/Profile.php @@ -50,10 +50,10 @@ class Profile implements \JsonSerializable /** * Birthday. * - * @var \DateTime + * @var null|\DateTime * @since 1.0.0 */ - protected \DateTime $birthday; + protected ?\DateTime $birthday = null; /** * Account. @@ -90,7 +90,7 @@ class Profile implements \JsonSerializable { $this->image = new NullMedia(); $this->birthday = new \DateTime('now'); - $this->account = $account ?? new Account(); + $this->account = $account ?? new NullAccount(); } /** @@ -212,13 +212,13 @@ class Profile implements \JsonSerializable /** * Set birthday. * - * @param \DateTime $birthday Birthday + * @param null|\DateTime $birthday Birthday * * @return void * * @since 1.0.0 */ - public function setBirthday(\DateTime $birthday) : void + public function setBirthday(?\DateTime $birthday) : void { $this->birthday = $birthday; } @@ -226,11 +226,11 @@ class Profile implements \JsonSerializable /** * Get birthday. * - * @return \DateTime + * @return null|\DateTime * * @since 1.0.0 */ - public function getBirthday() : \DateTime + public function getBirthday() : ?\DateTime { return $this->birthday; } diff --git a/Theme/Backend/profile-single.tpl.php b/Theme/Backend/profile-single.tpl.php index ceb1ad9..d54baae 100644 --- a/Theme/Backend/profile-single.tpl.php +++ b/Theme/Backend/profile-single.tpl.php @@ -83,7 +83,7 @@ echo $this->getData('nav')->render();