From 89befe877db6882524a7909ac730c91633e580f9 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Dadashi Date: Fri, 19 Jan 2024 07:29:10 +0330 Subject: [PATCH] fix psalm error --- src/Models/UserIdentityModel.php | 6 +++--- src/Models/UserModel.php | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Models/UserIdentityModel.php b/src/Models/UserIdentityModel.php index 73b3fb831..9366cfd4c 100644 --- a/src/Models/UserIdentityModel.php +++ b/src/Models/UserIdentityModel.php @@ -542,15 +542,15 @@ public function forceGlobalPasswordReset(): void * Throws an Exception when it fails. * * @param array|int|string|null $id - * @param array|object|null $data + * @param array|object|null $row * * @return true if the update is successful * * @throws ValidationException */ - public function update($id = null, $data = null): bool + public function update($id = null, $row = null): bool { - $result = parent::update($id, $data); + $result = parent::update($id, $row); $this->checkQueryReturn($result); diff --git a/src/Models/UserModel.php b/src/Models/UserModel.php index 2cc1210e3..55c76081a 100644 --- a/src/Models/UserModel.php +++ b/src/Models/UserModel.php @@ -251,18 +251,18 @@ public function activate(User $user): void * Override the BaseModel's `insert()` method. * If you pass User object, also inserts Email Identity. * - * @param array|User $data + * @param array|User $row * * @return int|string|true Insert ID if $returnID is true * * @throws ValidationException */ - public function insert($data = null, bool $returnID = true) + public function insert($row = null, bool $returnID = true) { // Clone User object for not changing the passed object. - $this->tempUser = $data instanceof User ? clone $data : null; + $this->tempUser = $row instanceof User ? clone $row : null; - $result = parent::insert($data, $returnID); + $result = parent::insert($row, $returnID); $this->checkQueryReturn($result); @@ -274,20 +274,20 @@ public function insert($data = null, bool $returnID = true) * If you pass User object, also updates Email Identity. * * @param array|int|string|null $id - * @param array|User $data + * @param array|User $row * * @return true if the update is successful * * @throws ValidationException */ - public function update($id = null, $data = null): bool + public function update($id = null, $row = null): bool { // Clone User object for not changing the passed object. - $this->tempUser = $data instanceof User ? clone $data : null; + $this->tempUser = $row instanceof User ? clone $row : null; try { /** @throws DataException */ - $result = parent::update($id, $data); + $result = parent::update($id, $row); } catch (DataException $e) { // When $data is an array. if ($this->tempUser === null) { @@ -316,15 +316,15 @@ public function update($id = null, $data = null): bool * Override the BaseModel's `save()` method. * If you pass User object, also updates Email Identity. * - * @param array|User $data + * @param array|User $row * * @return true if the save is successful * * @throws ValidationException */ - public function save($data): bool + public function save($row): bool { - $result = parent::save($data); + $result = parent::save($row); $this->checkQueryReturn($result);