From 5b09bc61859606f4f79e17019a085bf1aaf99a2b Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 16 Apr 2024 19:10:58 +0530 Subject: [PATCH] Fix psalm errors --- psalm.xml | 2 ++ src/Model/Behavior/TrashBehavior.php | 5 +++-- tests/bootstrap.php | 3 --- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/psalm.xml b/psalm.xml index a09944e..b192091 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,6 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" + findUnusedBaselineEntry="true" + findUnusedCode="false" > diff --git a/src/Model/Behavior/TrashBehavior.php b/src/Model/Behavior/TrashBehavior.php index ce878b1..94402c3 100644 --- a/src/Model/Behavior/TrashBehavior.php +++ b/src/Model/Behavior/TrashBehavior.php @@ -295,12 +295,13 @@ public function cascadingRestoreTrash( foreach ($this->_table->associations() as $association) { if ($this->_isRecursable($association, $this->_table)) { if ($entity === null) { - if ($result) { + if ($result > 1) { $result += $association->getTarget()->cascadingRestoreTrash(null, $options); } } else { - /** @var array $foreignKey */ + /** @var list $foreignKey */ $foreignKey = (array)$association->getForeignKey(); + /** @var list $bindingKey */ $bindingKey = (array)$association->getBindingKey(); $conditions = array_combine($foreignKey, $entity->extract($bindingKey)); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ca891ba..eae831c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,8 +1,6 @@