intelephense

1.14.41.16.1
lib/stub/mongodb/Server.php
lib/stub/mongodb/Server.php
+24−8
Index: package/lib/stub/mongodb/Server.php
===================================================================
--- package/lib/stub/mongodb/Server.php
+++ package/lib/stub/mongodb/Server.php
@@ -2,8 +2,9 @@
 
 namespace MongoDB\Driver;
 
 use MongoDB\Driver\Exception\AuthenticationException;
+use MongoDB\Driver\Exception\BulkWriteCommandException;
 use MongoDB\Driver\Exception\BulkWriteException;
 use MongoDB\Driver\Exception\ConnectionException;
 use MongoDB\Driver\Exception\InvalidArgumentException;
 use MongoDB\Driver\Exception\RuntimeException;
@@ -41,33 +42,48 @@
      * Execute one or more write operations on this server
      * @link https://php.net/manual/en/mongodb-driver-server.executebulkwrite.php
      * @param string $namespace A fully qualified namespace (e.g. "databaseName.collectionName").
      * @param BulkWrite $bulkWrite The MongoDB\Driver\BulkWrite to execute.
-     * @param array|WriteConcern|null $options
+     * @param array|null $options
      * @throws BulkWriteException on any write failure (e.g. write error, failure to apply a write concern).
      * @throws InvalidArgumentException on argument parsing errors.
      * @throws ConnectionException if connection to the server fails (for reasons other than authentication).
      * @throws AuthenticationException if authentication is needed and fails.
      * @throws RuntimeException on other errors.
      * @return WriteResult
      * @since 1.0.0
      */
-    final public function executeBulkWrite(string $namespace, BulkWrite $bulkWrite, array|WriteConcern|null $options = null): WriteResult {}
+    final public function executeBulkWrite(string $namespace, BulkWrite $bulkWrite, array|null $options = null): WriteResult {}
 
     /**
+     * Execute write operations on this server using the bulkWrite command
+     * @link https://php.net/manual/en/mongodb-driver-server.executebulkwritecommand.php
+     * @param BulkWriteCommand $bulkWriteCommand The write(s) to execute.
+     * @param array|null $options
+     * @throws BulkWriteCommandException on any write failure (e.g. write error, failure to apply a write concern).
+     * @throws InvalidArgumentException on argument parsing errors.
+     * @throws ConnectionException if connection to the server fails (for reasons other than authentication).
+     * @throws AuthenticationException if authentication is needed and fails.
+     * @throws RuntimeException on other errors.
+     * @return BulkWriteCommandResult
+     * @since 2.1.0
+     */
+    final public function executeBulkWriteCommand(BulkWriteCommand $bulkWriteCommand, ?array $options = null): BulkWriteCommandResult {}
+
+    /**
      * Execute a database command on this server
      * @link https://php.net/manual/en/mongodb-driver-server.executecommand.php
      * @param string $db The name of the database on which to execute the command.
      * @param Command $command The MongoDB\Driver\Command to execute.
-     * @param array|ReadPreference|null $options Optionally, a MongoDB\Driver\ReadPreference to select the server for this operation. If none is given, the read preference from the MongoDB Connection URI will be used.
+     * @param array|null $options Optionally, a MongoDB\Driver\ReadPreference to select the server for this operation. If none is given, the read preference from the MongoDB Connection URI will be used.
      * @throws InvalidArgumentException on argument parsing errors.
      * @throws ConnectionException if connection to the server fails (for reasons other than authentication).
      * @throws AuthenticationException if authentication is needed and fails.
      * @throws RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary).
      * @return Cursor
      * @since 1.0.0
      */
-    final public function executeCommand(string $db, Command $command, array|ReadPreference|null $options = null): Cursor {}
+    final public function executeCommand(string $db, Command $command, array|null $options = null): CursorInterface {}
 
     /**
      * Execute a database command that reads on this server
      * @link https://secure.php.net/manual/en/mongodb-driver-server.executereadcommand.php
@@ -79,9 +95,9 @@
      * @throws AuthenticationException If authentication is needed and fails.
      * @throws RuntimeException On other errors (e.g. invalid command).
      * @since 1.4.0
      */
-    final public function executeReadCommand(string $db, Command $command, ?array $options = null): Cursor {}
+    final public function executeReadCommand(string $db, Command $command, ?array $options = null): CursorInterface {}
 
     /**
      * Execute a database command that reads and writes on this server
      * @link https://secure.php.net/manual/en/mongodb-driver-server.executereadwritecommand.php
@@ -93,9 +109,9 @@
      * @throws AuthenticationException If authentication is needed and fails.
      * @throws RuntimeException On other errors (e.g. invalid command).
      * @since 1.4.0
      */
-    final public function executeReadWriteCommand(string $db, Command $command, ?array $options = null): Cursor {}
+    final public function executeReadWriteCommand(string $db, Command $command, ?array $options = null): CursorInterface {}
 
     /**
      * Execute a database command that writes on this server
      * @link https://secure.php.net/manual/en/mongodb-driver-server.executewritecommand.php
@@ -107,9 +123,9 @@
      * @throws AuthenticationException If authentication is needed and fails.
      * @throws RuntimeException On other errors (e.g. invalid command).
      * @since 1.4.0
      */
-    final public function executeWriteCommand(string $db, Command $command, ?array $options = null): Cursor {}
+    final public function executeWriteCommand(string $db, Command $command, ?array $options = null): CursorInterface {}
 
     /**
      * Execute a database query on this server
      * @link https://php.net/manual/en/mongodb-driver-server.executequery.php
@@ -121,9 +137,9 @@
      * @throws AuthenticationException if authentication is needed and fails.
      * @throws RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary).
      * @return Cursor
      */
-    final public function executeQuery(string $namespace, Query $query, array|ReadPreference|null $options = null): Cursor {}
+    final public function executeQuery(string $namespace, Query $query, array|ReadPreference|null $options = null): CursorInterface {}
 
     /**
      * Returns the hostname of this server
      * @link https://php.net/manual/en/mongodb-driver-server.gethost.php