From 7797702b63631656dd639366cdfc76210e4e84d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 5 Mar 2025 08:41:46 +0100 Subject: [PATCH 1/2] Fix CS --- src/Attribute/AutowireCollection.php | 1 - tests/Functional/DataCollector/DriverEventSubscriberTest.php | 2 +- tests/Unit/Attribute/AttributeTestCase.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Attribute/AutowireCollection.php b/src/Attribute/AutowireCollection.php index a442bd7..5627157 100644 --- a/src/Attribute/AutowireCollection.php +++ b/src/Attribute/AutowireCollection.php @@ -34,7 +34,6 @@ use Symfony\Component\DependencyInjection\Reference; use function is_string; -use function ltrim; use function sprintf; /** diff --git a/tests/Functional/DataCollector/DriverEventSubscriberTest.php b/tests/Functional/DataCollector/DriverEventSubscriberTest.php index b729e89..2f9a2ce 100644 --- a/tests/Functional/DataCollector/DriverEventSubscriberTest.php +++ b/tests/Functional/DataCollector/DriverEventSubscriberTest.php @@ -31,7 +31,7 @@ public function collectCommandEvent(int $clientId, string $requestId, array $dat } }; - $this->stopwatch = new Stopwatch();; + $this->stopwatch = new Stopwatch(); } public function testCommandSucceeded(): void diff --git a/tests/Unit/Attribute/AttributeTestCase.php b/tests/Unit/Attribute/AttributeTestCase.php index e7ee39e..0a9ec3a 100644 --- a/tests/Unit/Attribute/AttributeTestCase.php +++ b/tests/Unit/Attribute/AttributeTestCase.php @@ -1,5 +1,7 @@ Date: Fri, 21 Mar 2025 10:12:09 +0100 Subject: [PATCH 2/2] Support MongoDB Driver 2.0 (#24) * Support version 2.0 of the MongoDB driver * Test with driver version 2.x in CI --- .github/workflows/ci.yaml | 11 ++++++++++- composer.json | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 10fdd38..4756bda 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ permissions: jobs: test: - name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} + name: PHP ${{ matrix.php-version }} + ${{ matrix.driver-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }} runs-on: ubuntu-latest @@ -46,6 +46,8 @@ jobs: - '8.2' - '8.3' - '8.4' + driver-version: + - 'stable' dependencies: - 'highest' - 'lowest' @@ -56,6 +58,12 @@ jobs: - 'symfony/symfony:"6.3.*"' - 'symfony/symfony:"6.4.*"' - 'symfony/symfony:"7.0.*"' + include: + - php-version: '8.4' + driver-version: 'mongodb/mongo-php-driver@v2.x' + dependencies: 'highest' + symfony-require: '' + variant: 'normal' steps: - name: Checkout @@ -65,6 +73,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: "mongodb-${{ matrix.driver-version }}" - name: Add PHPUnit matcher run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" diff --git a/composer.json b/composer.json index cba6e6b..a5a803e 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ ], "require": { "php": ">=8.1", - "ext-mongodb": "^1.21", - "mongodb/mongodb": "^1.21", + "ext-mongodb": "^1.21 || ^2.0@dev", + "mongodb/mongodb": "^1.21 || ^2.0@dev", "symfony/config": "^6.3 || ^7.0", "symfony/console": "^6.3 || ^7.0", "symfony/dependency-injection": "^6.3.5 || ^7.0",