diff --git a/composer.lock b/composer.lock index 52cee61cbf..0fa64a4865 100644 --- a/composer.lock +++ b/composer.lock @@ -4,27 +4,28 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "104758a98a297851d8985a60cbfa65bc", + "content-hash": "6def0d090ef1b5df4a7d2af3ea71fe1c", "packages": [ { "name": "mongodb/mongodb", - "version": "1.21.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a" + "reference": "3bbe7ba9578724c7e1f47fcd17c881c0995baaad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", - "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/3bbe7ba9578724c7e1f47fcd17c881c0995baaad", + "reference": "3bbe7ba9578724c7e1f47fcd17c881c0995baaad", "shasum": "" }, "require": { "composer-runtime-api": "^2.0", - "ext-mongodb": "^1.21.0", + "ext-mongodb": "^2.1", "php": "^8.1", - "psr/log": "^1.1.4|^2|^3" + "psr/log": "^1.1.4|^2|^3", + "symfony/polyfill-php85": "^1.32" }, "replace": { "mongodb/builder": "*" @@ -78,9 +79,9 @@ ], "support": { "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/1.21.1" + "source": "https://github.com/mongodb/mongo-php-library/tree/2.1.0" }, - "time": "2025-02-28T17:24:20+00:00" + "time": "2025-05-23T10:48:05+00:00" }, { "name": "psr/log", @@ -131,6 +132,82 @@ "source": "https://github.com/php-fig/log/tree/3.0.2" }, "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "6fedf31ce4e3648f4ff5ca58bfd53127d38f05fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/6fedf31ce4e3648f4ff5ca58bfd53127d38f05fd", + "reference": "6fedf31ce4e3648f4ff5ca58bfd53127d38f05fd", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.32.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-05-02T08:40:52+00:00" } ], "packages-dev": [ diff --git a/src/Client.php b/src/Client.php index 8519d55312..2e61c49451 100644 --- a/src/Client.php +++ b/src/Client.php @@ -756,7 +756,7 @@ class Client 'lsid' => $lsid, 'txnNumber' => $txnNumber, 'autocommit' => $autocommit - ], 'admin'); + ], 'admin'); // End the session after successful commit $this->endSessions([$lsid]); @@ -775,7 +775,6 @@ class Client */ public function abortTransaction(array $lsid, int $txnNumber, bool $autocommit = false) { - $txnNumber = new \MongoDB\BSON\Int64($txnNumber); $result = $this->query([ @@ -783,7 +782,7 @@ class Client 'lsid' => $lsid, 'txnNumber' => $txnNumber, 'autocommit' => $autocommit - ], 'admin'); + ], 'admin'); // End the session after successful rollback $this->endSessions([$lsid]); @@ -908,5 +907,4 @@ class Client $this->replicaSet = property_exists($result, 'setName'); return $this->replicaSet; } - } diff --git a/tests/MongoTest.php b/tests/MongoTest.php index 56f2c5879c..aba9be3653 100644 --- a/tests/MongoTest.php +++ b/tests/MongoTest.php @@ -110,7 +110,6 @@ class MongoTest extends TestCase public function testCreateDocuments(): array { - $docs = $this->getDatabase()->insertMany( 'movies', [ @@ -237,7 +236,7 @@ class MongoTest extends TestCase 'country' => 'UK', 'counter' => 1 ] - ); + ); $this->getDatabase()->upsert('movies_upsert', [ [ @@ -262,5 +261,4 @@ class MongoTest extends TestCase self::assertEquals('USA', $documents[1]->country); self::assertEquals('English', $documents[1]->language); } - }