From 2f50532e13c02f8cc7db5531cb9f1755a221e1f6 Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 10 Oct 2025 21:06:11 -0300 Subject: [PATCH] refactor(Model): Type hint setNull variadic arguments --- src/Libs/Model.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Libs/Model.php b/src/Libs/Model.php index e58d628..f31d0f6 100644 --- a/src/Libs/Model.php +++ b/src/Libs/Model.php @@ -985,19 +985,12 @@ class Model * * @return void */ - public function setNull(...$attributes): void + public function setNull(string ...$attributes): void { - if (is_array($attributes)) { - foreach ($attributes as $att) { - if (!in_array($att, $this->toNull)) { - $this->toNull[] = $att; - } + foreach ($attributes as $att) { + if (!in_array($att, $this->toNull)) { + $this->toNull[] = $att; } - return; - } - - if (!in_array($attributes, $this->toNull)) { - $this->toNull[] = $attributes; } } }