-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecations in CommandDataCollector #856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll have to take a look at what phpcs is complaining about.
@@ -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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmikola This reminds me that we should have a way to get the command document as BSON so we can safe ourselves the round trip conversion.
Rebased onto 5.0.x as we no longer support 4.x. |
Could you please copy changes from this my PR to branch 4.7.x? I can't migrate away from annotations (4.7.x) to attributes (5.0.x) in my big project just now. So I will be able to temporarily switch to the branch 4.7.x-dev in my project (if 4.x is no longer supported). Thank you very much. |
You can maintain a separate version of 4.7.x in your own fork and use that by adding a VCS repository in composer.json. 4.x is no longer supported by us, and the deprecation notices are emitted by PHP itself based on tentative return types added to the extension. They'll let you know that the return type will change in the future, but if you're not planning to upgrade (and as a matter of fact, won't be able to with 4.x) then you can safely ignore them and send them to the digital waste bin. |
Ok, there is nothing else to do. Done — 4.7.1. |
Description
Fix deprecations in method
collect()
of class\Doctrine\Bundle\MongoDBBundle\DataCollector\CommandDataCollector
.Fix deprecations on PHP version 8.3 and
ext-mongodb
version 1.20:Deprecated: Function MongoDB\BSON\fromPHP() is deprecated in vendor/doctrine/mongodb-odm-bundle/DataCollector/CommandDataCollector.php on line 39.
Deprecated: Function MongoDB\BSON\toCanonicalExtendedJSON() is deprecated in vendor/doctrine/mongodb-odm-bundle/DataCollector/CommandDataCollector.php on line 39.