From 9653d7872e575d19632cc3021500ea6be9b3cfb0 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sun, 8 Oct 2023 21:57:28 +0200 Subject: [PATCH] Use strict typing --- src/Traits/Getter.php | 5 +++-- src/Traits/Setter.php | 2 +- src/Traits/Singleton.php | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Traits/Getter.php b/src/Traits/Getter.php index 41f65a6..f7bdd0b 100644 --- a/src/Traits/Getter.php +++ b/src/Traits/Getter.php @@ -1,4 +1,4 @@ - @@ -69,7 +69,8 @@ trait Getter $value = $this->__get($property); } catch (\InvalidArgumentException) { $value = null; + } finally { + return !empty($value); } - return !empty($value); } } diff --git a/src/Traits/Setter.php b/src/Traits/Setter.php index 6aa3e85..246f262 100644 --- a/src/Traits/Setter.php +++ b/src/Traits/Setter.php @@ -1,4 +1,4 @@ - diff --git a/src/Traits/Singleton.php b/src/Traits/Singleton.php index 5be752d..6a489be 100644 --- a/src/Traits/Singleton.php +++ b/src/Traits/Singleton.php @@ -1,4 +1,4 @@ - @@ -69,8 +69,10 @@ trait Singleton * This is a singleton class, thus cloning is prohibited. * * @access private + * + * @return void */ - final private function __clone() + final private function __clone(): void { } }