-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Logging Doctrine deprecations with Symfony? #1662
Comments
The easiest way would be to do this I suppose: DoctrineBundle/Tests/bootstrap.php Line 7 in e6da248
I think maybe that's one of the things the bundle should do… when booting? Or maybe later, conditionally, based on a config setting? In case this might be unwanted/considered a breaking change? Or maybe it should be possible to fully configure the library with https://github.com/doctrine/deprecations#usage-from-consumer-perspective IIRC there was at some point a discussion about splitting this repo into a DBAL bundle and an ORM bundle, so I'm not 100% sure if this is the right place, or if the doctrine bridge would preferred for this. |
See #1300 (comment) for the discussion. The dedicated bundle should do it on boot time IMO. |
I'm glad this discussion finally moves forward. |
I think that would be acceptable, since it's about a one-liner that does not need any configuration.
Definitely something we should document if we go that way. @stof said it could be required by the bundle, I suppose it would be suggested in 2.x, and required in 3.x then, right? |
@greg0ire we can add the new requirements in the next minor 2.x version IMO. This new package won't break projects (the Symfony deprecation tooling is precisely meant to not break things when deprecations are reported) |
I thought we might save ourself from creating any new package by allowing this to be configured via env var. |
What was the reason for not making DoctrineBundle set up this way of error logging by default? That there may be too many deprecation notices that would cause a performance impact? Or that it would not cover all doctrine/* package use cases (people using doctrine/something but not DoctrineBundle)? Or that we don’t want DoctrineBundle to configure the error reporting that might affect doctrine/* packages other than DBAL/ORM? |
Neat technical trick, but seems completely unexpected/unusual to me and nothing I‘d favor from the DX perspective. |
I have opposite opinion. Nobody wants to have mixed approach of handling deprecations in a symfony project and that's how it is unless you enable trigger_error for doctrine/deprecations. Rest of the symfony packages don't have this configurability. Merging that would make all deprecations in symfony projects to behave consistently, which is what is expected.
Because it would not work for other doctrine bundles, such as doctrine/mongodb-odm-bundle or awaited doctrine/dbal-bundle. Hence it's a wrong project. This is why I opened a PR for symfony/doctrine-bridge, since it's something all of these share. Answer was symfony/doctrine-bridge is not generic enough. Well, in that case other existing bundles definitely ain't generic enough either. |
Should be fixed by symfony/symfony#50468 |
…ations as expected (nicolas-grekas) This PR was merged into the 6.3 branch. Discussion ---------- [FrameworkBundle][PhpUnitBridge] Configure doctrine/deprecations as expected | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix doctrine/DoctrineBundle#1662 | License | MIT | Doc PR | - Following doctrine/deprecations#41, so that deprecations from Doctrine take the same code path as any other deprecations in Symfony apps. Submitted to 6.3 to notify about the deprecations as early as possible but not too early to not trigger new deprecations in existing apps. Commits ------- cbe4808 [FrameworkBundle][PhpUnitBridge] Configure doctrine/deprecations as expected
What is the easiest way to log deprecations emitted by the Doctrine codebase in the same way, same place, using the same mechanism that is used to deal with Symfony deprecations?
Is this something this bundle can help with?
The text was updated successfully, but these errors were encountered: