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
This commit is contained in:
Victor Westerlund 2026-02-22 14:41:41 +01:00
parent 2d55d954a1
commit bd6ab2be3a

View file

@ -109,6 +109,6 @@
->where($this->where) ->where($this->where)
->update([$key => $value]); ->update([$key => $value]);
return $return ?? $value; return func_num_args() === 2 ? $value : $return;
} }
} }