From 71a9f12b02569161f83f5d7725a11e2ec9eed676 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sun, 22 Feb 2026 14:41:41 +0100 Subject: [PATCH] fix: use `func_num_args()` to determine if `$return` should be used for `Database\Model` (#30) It was not possible to set the return type explicitly as `null`, since that was the value we checked for if we should return the value of `$return` or not. We're not checking the total amount of arguments provided to check if a `$return` value was passed or not. Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/30 --- src/Database/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/Model.php b/src/Database/Model.php index d7674fb..f0c1e01 100644 --- a/src/Database/Model.php +++ b/src/Database/Model.php @@ -109,6 +109,6 @@ ->where($this->where) ->update([$key => $value]); - return $return ?? $value; + return func_num_args() === 2 ? $value : $return; } }