Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 95eda6c

Browse files
committed
Add @param without psalm or phpstan custom type
1 parent 257f11b commit 95eda6c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

‎src/Collection.php‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@
7878
use function is_bool;
7979
use function strlen;
8080

81-
/** @psalm-import-type OperationType from BulkWrite */
81+
/**
82+
* @psalm-import-type OperationType from BulkWrite
83+
* @phpstan-import-type OperationType from BulkWrite
84+
*/
8285
class Collection
8386
{
8487
private const DEFAULT_TYPE_MAP = [
@@ -262,12 +265,14 @@ public function aggregate(array|Pipeline $pipeline, array $options = []): Cursor
262265
/**
263266
* Executes multiple write operations.
264267
*
265-
* @see BulkWrite::__construct() for supported options
268+
* @param list<array{deleteMany: array{0: object|array, 1?: array}}|array{deleteOne: array{0: object|array, 1?: array}}|array{insertOne: array{0: object|array}}|array{replaceOne: array{0: object|array, 1: object|array, 2?: array}}|array{updateMany: array{0: object|array, 1: object|array, 2?: array}}|array{updateOne: array{0: object|array, 1: object|array, 2?: array}}> $operations List of write operations
266269
* @psalm-param list<OperationType> $operations List of write operations
267-
* @param array $options Command options
270+
* @phpstan-param list<OperationType> $operations List of write operations
271+
* @param array $options Command options
268272
* @throws UnsupportedException if options are not supported by the selected server
269273
* @throws InvalidArgumentException for parameter/option parsing errors
270274
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
275+
* @see BulkWrite::__construct() for supported options
271276
*/
272277
public function bulkWrite(array $operations, array $options = []): BulkWriteResult
273278
{

‎src/Operation/BulkWrite.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
*
4949
* @psalm-type Document = object|array
5050
* @psalm-type OperationType = array{deleteMany: array{0: Document, 1?: array}}|array{deleteOne: array{0: Document, 1?: array}}|array{insertOne: array{0: Document}}|array{replaceOne: array{0: Document, 1: Document, 2?: array}}|array{updateMany: array{0: Document, 1: Document, 2?: array}}|array{updateOne: array{0: Document, 1: Document, 2?: array}}
51+
* @psalm-type Document = object|array
52+
* @phpstan-type OperationType = array{deleteMany: array{0: Document, 1?: array}}|array{deleteOne: array{0: Document, 1?: array}}|array{insertOne: array{0: Document}}|array{replaceOne: array{0: Document, 1: Document, 2?: array}}|array{updateMany: array{0: Document, 1: Document, 2?: array}}|array{updateOne: array{0: Document, 1: Document, 2?: array}}
5153
*/
5254
final class BulkWrite
5355
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /