-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Revert adding silent deprecations for legacy ClassLoader, Inflector and Lexer #849
Conversation
… and Lexer" This reverts commit 39bc396.
I don't understand this bit: this would lead to a patch release with functional changes, no? |
Well, I would rather make a 2.6.3 release of the ORM which would have the fix merged in it to make the ORM stop using these deprecated APIs. The goal of these warnings is precisely to make it clear when a deprecated API is used, to push to migrate. The ORM was still using some APIs deprecated years ago. The phpunit-bridge opting-in for the report of deprecations has precisely this goal: reporting when your code uses deprecated APIs. |
This is not the right move for Doctrine and its users (including Symfony): triggering silenced deprecations is the way to go. As @stof explained above and on symfony/symfony#27936, depractions are opt-in on Symfony also. |
It would be if Symfony hadn't started turning them into hard errors for anything in vendor without intentionally enabling this behavior.
No, they are not, see symfony/symfony#27936 (comment). This erroneous behavior is enabled by default and exits with code 1. |
The right move IMHO is to resubmit symfony/symfony#27609 now that Doctrine doesn't use its own deprecated things internally. |
To make it clear what the expected behavior is (to me and also to other end-user consumers):
Symfony's default behavior currently violates 3) and 4). At this moment I recommend abandoning the concept of
Agreed that it should be resubmitted, but this PR is rather about issues like doctrine/orm#7306 because of doctrine/orm#7307. |
I'd recommend to close this PR. |
The default behavior of PHPUnit Bridge is still wrong in my eyes, by default it's reporting issues that are out-of-scope for the project where it's used.
This is primarily about everyone out there who now gets deprecation errors and test failures just because Doctrine ORM internally calls deprecated ClassLoader from Doctrine Common. |
That's not our problem, and that's not a reason to drop these deprecation warnings. The change to the phpunit-bridge prevents failing builds due to these deprecations while still reporting them (which people can turn off using
The fix to that is publishing a release with these usages dropped and be done with it, not get into an even lengthier discussion about these deprecations. Obviously, the deprecations will show up for some users who aren't running the latest version, but if you're running the latest version of one dependency and an older version of another that's something you have to expect and deal with. After the deprecation is done, the focus should be to drop the deprecated behavior as soon as possible. As for reevaluating "usefulness of the concept of silent deprecations for future use": these deprecations are extremely useful when preparing a major version upgrade, so we should keep them in at all costs. If the tooling around them is sub-optimal, that's not our problem. Instead, this should be fixed upstream instead of dropping the concept altogether. With that said, I'm closing this PR. |
Reverts 39bc396 in 2.9.
In #845 we added silent deprecations using the
@trigger_error(..., E_USER_DEPRECATED)
pattern (suggested in #845 (comment)).This concept was originally created in a good faith to let users opt-in for deprecations only when they are interested in seeing them and aware it could happen (thus expecting deprecations may appear) and show none by default (for everyone else who doesn't opt-in).
Unfortunately Symfony had started misusing this concept and has turned it to opt-out, just like if these were non-silent deprecations without
@
(messages logged, printed out and tests error out with exit code 1). In the end this means users are now seeing silenced deprecations unexpectedly without ever opting-in (in tests, debug toolbar etc.) and it breaks their test suite / CI.Causes issues like: doctrine/orm#7306
Further (out-of-scope discussion): symfony/symfony#27936
Proposal: Revert now for 2.9, release as 2.9.1. Then reevaluate usefulness of the concept of silent deprecations for future use.