From d4299e05c0b5cb49050e86ed09ef2d10d6677385 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Mon, 25 Dec 2023 00:12:38 +0700 Subject: [PATCH] Fix psalm issues --- src/ActiveRecord.php | 4 ---- src/BaseActiveRecord.php | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ActiveRecord.php b/src/ActiveRecord.php index 31ac97320..a2e872c39 100644 --- a/src/ActiveRecord.php +++ b/src/ActiveRecord.php @@ -366,10 +366,6 @@ protected function deleteInternal(): false|int $condition = $this->getOldPrimaryKey(true); $lock = $this->optimisticLock(); - if (is_array($condition) === false) { - return false; - } - if ($lock !== null) { $condition[$lock] = $this->$lock; } diff --git a/src/BaseActiveRecord.php b/src/BaseActiveRecord.php index 11b739de2..4b278dba0 100644 --- a/src/BaseActiveRecord.php +++ b/src/BaseActiveRecord.php @@ -68,10 +68,6 @@ public function delete(): false|int */ $condition = $this->getOldPrimaryKey(true); - if (is_array($condition) === false) { - return false; - } - $lock = $this->optimisticLock(); if ($lock !== null) { @@ -261,7 +257,7 @@ public function getPrimaryKey(bool $asArray = false): mixed { $keys = $this->primaryKey(); - if (!$asArray && count($keys) === 1) { + if ($asArray === false && count($keys) === 1) { return $this->attributes[$keys[0]] ?? null; }