From bb5a272a0423985b61a382a1fa77c936d207eed2 Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Sun, 10 Oct 2021 13:58:23 +0200 Subject: [PATCH] Fix return types --- galette/lib/Galette/Core/Authentication.php | 26 ++++++++++----------- galette/lib/Galette/Entity/Adherent.php | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/galette/lib/Galette/Core/Authentication.php b/galette/lib/Galette/Core/Authentication.php index af867ad6e..a59d60aaa 100644 --- a/galette/lib/Galette/Core/Authentication.php +++ b/galette/lib/Galette/Core/Authentication.php @@ -175,9 +175,9 @@ abstract class Authentication * * @return bool */ - public function isAdmin() + public function isAdmin(): bool { - return $this->admin; + return (bool)$this->admin; } /** @@ -185,9 +185,9 @@ abstract class Authentication * * @return bool */ - public function isSuperAdmin() + public function isSuperAdmin(): bool { - return $this->superadmin; + return (bool)$this->superadmin; } /** @@ -195,9 +195,9 @@ abstract class Authentication * * @return bool */ - public function isActive() + public function isActive(): bool { - return $this->active; + return (bool)$this->active; } /** @@ -205,9 +205,9 @@ abstract class Authentication * * @return bool */ - public function isStaff() + public function isStaff(): bool { - return $this->staff; + return (bool)$this->staff; } /** @@ -215,9 +215,9 @@ abstract class Authentication * * @return bool */ - public function isCron() + public function isCron(): bool { - return $this->cron; + return (bool)$this->cron; } /** @@ -229,7 +229,7 @@ abstract class Authentication * * @return boolean */ - public function isGroupManager($id_group = null) + public function isGroupManager($id_group = null): bool { $manager = false; if ($this->isAdmin() || $this->isStaff()) { @@ -258,9 +258,9 @@ abstract class Authentication * * @return bool */ - public function isUp2Date() + public function isUp2Date(): bool { - return $this->uptodate; + return (bool)$this->uptodate; } /** diff --git a/galette/lib/Galette/Entity/Adherent.php b/galette/lib/Galette/Entity/Adherent.php index da94a5c5f..624c01fe9 100644 --- a/galette/lib/Galette/Entity/Adherent.php +++ b/galette/lib/Galette/Entity/Adherent.php @@ -2057,6 +2057,8 @@ class Adherent if ($preferences->pref_bool_create_member && $login->isLogged()) { return true; } + + return false; } /** -- 2.39.2