From fd4848ba09d0eec2121b35dcc6c5532d06ece5df Mon Sep 17 00:00:00 2001 From: "Paul M. Jones" Date: Tue, 27 Nov 2018 15:55:04 -0600 Subject: [PATCH] rewrite value object --- tests/Domain/Value/Value.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/Domain/Value/Value.php b/tests/Domain/Value/Value.php index bb9a8f6..2da4396 100644 --- a/tests/Domain/Value/Value.php +++ b/tests/Domain/Value/Value.php @@ -17,7 +17,7 @@ public function __construct() $this->__INITIALIZED__ = true; } - public function __get(string $key) + public function __get(string $key) // : mixed { return $this->$key; } @@ -27,7 +27,7 @@ public function __set(string $key, $val) : void throw $this->immutableException(); } - public function __isset(string $key) + public function __isset(string $key) : bool { return isset($this->$key); } @@ -39,12 +39,10 @@ public function __unset(string $key) : void public function __debugInfo() : array { - $info = get_object_vars($this); - unset($info['__INITIALIZED__']); - return $info; + return $this->getArrayCopy(); } - public function getArrayCopy() + public function getArrayCopy() : array { $copy = get_object_vars($this); unset($copy['__INITIALIZED__']);