diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 81415312..dd7f14f7 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -11,4 +11,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.2.0" diff --git a/.github/workflows/composer-lint.yml b/.github/workflows/composer-lint.yml index aff94ca5..c6c88e31 100644 --- a/.github/workflows/composer-lint.yml +++ b/.github/workflows/composer-lint.yml @@ -15,4 +15,4 @@ on: jobs: composer-lint: name: "Composer Lint" - uses: "doctrine/.github/.github/workflows/composer-lint.yml@5.0.1" + uses: "doctrine/.github/.github/workflows/composer-lint.yml@5.2.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0a99034b..074f65cc 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -95,7 +95,7 @@ jobs: - name: "Upload coverage file" uses: "actions/upload-artifact@v4" with: - name: "phpunit-${{ matrix.php-version }}-${{ hashFiles(composer.lock) }}.coverage" + name: "phpunit-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}.coverage" path: "coverage.xml" upload_coverage: diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index e81871a4..2478d38d 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.0.1" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.2.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/README.markdown b/README.markdown index 25a7180c..6ed98079 100644 --- a/README.markdown +++ b/README.markdown @@ -14,7 +14,7 @@ Compatibility The current version of this bundle has the following requirements: * PHP 8.1 or newer is required - * `ext-mongodb` 1.5 or newer + * `ext-mongodb` 1.16 or newer * Symfony 6.4 or newer is required Support for older Symfony, PHP and MongoDB versions is provided via the `4.7.x` diff --git a/composer.json b/composer.json index 14ac3064..929c2ab0 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "homepage": "http://www.doctrine-project.org", "require": { "php": "^8.1", - "ext-mongodb": "^1.5", + "ext-mongodb": "^1.16", "composer-runtime-api": "^2.0", "doctrine/mongodb-odm": "^2.6", "doctrine/persistence": "^3.0", @@ -50,7 +50,7 @@ "symfony/stopwatch": "^6.4 || ^7.0", "symfony/validator": "^6.4 || ^7.0", "symfony/yaml": "^6.4 || ^7.0", - "vimeo/psalm": "^5.12" + "vimeo/psalm": "^5.25" }, "conflict": { "doctrine/data-fixtures": "<1.3" diff --git a/src/DataCollector/CommandDataCollector.php b/src/DataCollector/CommandDataCollector.php index cade11ca..7530d8a5 100644 --- a/src/DataCollector/CommandDataCollector.php +++ b/src/DataCollector/CommandDataCollector.php @@ -6,6 +6,7 @@ use Doctrine\ODM\MongoDB\APM\Command; use Doctrine\ODM\MongoDB\APM\CommandLogger; +use MongoDB\BSON\Document; use stdClass; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -16,8 +17,6 @@ use function array_reduce; use function count; use function json_decode; -use function MongoDB\BSON\fromPHP; -use function MongoDB\BSON\toCanonicalExtendedJSON; /** @internal */ final class CommandDataCollector extends DataCollector @@ -33,10 +32,11 @@ public function collect(Request $request, Response $response, ?Throwable $except 'commands' => array_map( static function (Command $command): array { $dbProperty = '$db'; + $document = Document::fromPHP($command->getCommand()); return [ 'database' => $command->getCommand()->$dbProperty ?? '', - 'command' => json_decode(toCanonicalExtendedJSON(fromPHP($command->getCommand()))), + 'command' => json_decode($document->toCanonicalExtendedJSON()), 'durationMicros' => $command->getDurationMicros(), ]; },