Skip to content

Commit 8d87daf

Browse files
Copilotabnegate
andcommitted
Fix PHPStan error: remove redundant $index check in renameIndex
The null check for $index at line 1125 guarantees it's non-null, making the $index && condition at line 1134 always true. PHPStan level 7 flagged this as "Left side of && is always true". Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
1 parent 1310180 commit 8d87daf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"swoole/ide-helper": "5.1.3",
5050
"utopia-php/cli": "0.14.*",
5151
"laravel/pint": "*",
52-
"phpstan/phpstan": "*",
52+
"phpstan/phpstan": "1.*",
5353
"rregeer/phpunit-coverage-check": "0.3.*"
5454
},
5555
"suggests": {

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Adapter/Mongo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ public function renameIndex(string $collection, string $old, string $new): bool
11311131
throw $this->processException($e);
11321132
}
11331133

1134-
if ($index && $deletedindex && $createdindex) {
1134+
if ($deletedindex && $createdindex) {
11351135
return true;
11361136
}
11371137

0 commit comments

Comments
 (0)