Skip to content

Commit

Permalink
PHPLIB-1563: set singleBatch option for findOne
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 19, 2024
1 parent caf7918 commit dc0650e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Operation/Find.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ private function createQueryOptions(): array
$options['batchSize']++;

Check failure on line 423 in src/Operation/Find.php

View workflow job for this annotation

GitHub Actions / Psalm

MixedOperand

src/Operation/Find.php:423:13: MixedOperand: Left operand cannot be mixed (see https://psalm.dev/059)

Check failure on line 423 in src/Operation/Find.php

View workflow job for this annotation

GitHub Actions / Psalm

MixedAssignment

src/Operation/Find.php:423:13: MixedAssignment: Unable to determine the type of this assignment (see https://psalm.dev/032)
}

if (isset($options['limit']) && $options['limit'] === 1) {
$options['singleBatch'] = true;
}

return $options;
}
}

0 comments on commit dc0650e

Please sign in to comment.