From: Kevin Day Date: Tue, 14 Aug 2018 04:28:03 +0000 (-0500) Subject: Cleanup: move has_value() to c_base_return and document guaranteed functions provided... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b49abf31128b44b0047b7aa80af2b5dbb9225a7e;p=koopa Cleanup: move has_value() to c_base_return and document guaranteed functions provided by c_base_return --- diff --git a/common/base/classes/base_return.php b/common/base/classes/base_return.php index 201d07c..17fcbcb 100644 --- a/common/base/classes/base_return.php +++ b/common/base/classes/base_return.php @@ -327,6 +327,16 @@ class c_base_return { public function get_value_exact() { return NULL; } + + /** + * Determine if this class has a value assigned to it. + * + * @return bool + * TRUE if a value is assigned, FALSE otherwise. + */ + public function has_value() { + return FALSE; + } } /** @@ -537,6 +547,16 @@ class c_base_return_value extends c_base_return { return $this->value; } + + /** + * Determine if this class has a value assigned to it. + * + * @return bool + * TRUE if a value is assigned, FALSE otherwise. + */ + public function has_value() { + return !is_null($this->value); + } } /** diff --git a/common/base/traits/base_return.php b/common/base/traits/base_return.php index 93406cc..332ff22 100644 --- a/common/base/traits/base_return.php +++ b/common/base/traits/base_return.php @@ -13,6 +13,9 @@ namespace n_koopa; * * Most return classes will use this trait. * + * This does not define has_value(), get_value(), and get_value_exact(). + * Those functions are always gauranteed by the class c_base_return. + * * @require class base_error */ trait t_base_return_value { @@ -41,16 +44,6 @@ trait t_base_return_value { } /** - * Determine if this class has a value assigned to it. - * - * @return bool - * TRUE if a value is assigned, FALSE otherwise. - */ - public function has_value() { - return !is_null($this->value); - } - - /** * Creates a new return __class__ type. * * This is used to simplify the returning of a new class value.