Skip to content

Commit

Permalink
Fix psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Apr 16, 2024
1 parent 413d4c4 commit 5b09bc6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<projectFiles>
<directory name="src" />
Expand Down
5 changes: 3 additions & 2 deletions src/Model/Behavior/TrashBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<array-key,array-key> $foreignKey */
/** @var list<string> $foreignKey */
$foreignKey = (array)$association->getForeignKey();
/** @var list<string> $bindingKey */
$bindingKey = (array)$association->getBindingKey();
$conditions = array_combine($foreignKey, $entity->extract($bindingKey));

Expand Down
3 changes: 0 additions & 3 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
declare(strict_types=1);

use Cake\Core\Configure;

/**
* Test suite bootstrap.
*
Expand Down Expand Up @@ -31,4 +29,3 @@
}

require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';

0 comments on commit 5b09bc6

Please sign in to comment.