-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] make "numbered" deprecation mode count only vendor deprecations #28048
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
Comments
I know that some library maintainers like @dbu like the |
Or maybe even better: keep the current behavior as is, but handle setting the max numbers of deprecations triggered "inside src/" vs "directly by src/" vs "indirectly (by src/ or config/)". |
when maintaining a library, errors on vendors triggering deprecations of other vendors is not much of a concern. i want to support a wide range of dependencies if possible. those deprecations are the concern of the users of my library, but not mine as library maintainer. i like the idea to be more precise. using comma separated will not make it more obvious what is going on (its quite cryptic already) but having 3 separate constants is not awesome either. i was going to say we should not change the semantics of the old syntax in minor versions, but as the symfony bundle test configuration matrix usually specify which symfony version to test with, its easy to use a different constant definition for different configurations. |
What about using an url-encoded string for configuration? Looks like the most flexible to me given the number of options people would like to have and we might want to add in the future. |
This sounds great! For the sake of completeness, I would have 4 keys:
This would mean:
And every key would default to 999999. |
Correct! I'm just wondering if "direct" should count internal too? They are also "direct calls to deprecated methods". Or we could be keep only direct (would include internal) and indirect. WDYT ? The regexp mode is absolutely required to debug deprecations, I'd keep it as is. The others we can think about simplifying. We could also have summary=0/1 (default to 1). |
I have written #24867 so that when we use sentences that use the words "caller" or "callees", we refer to packages, not to methods. Any stack trace can be divided into function calls, and those calls can be grouped by package easily if psr-0 or 4 is assumed (I hope that's a safe assumption to make). With that in mind,
I think @alexpott and other library maintainers would not want us to have direct include internal and make internal disappear. Also, I have witnessed a use case in a project in my company where you would want to forbid direct calls but allow internal deprecations because of the following scenario, which happen to me:
Another scenario is that you could want to deprecate something internally in your project that is used in many places and migrate from it step by step, while keeping direct calls to 0. A final argument against this would be that having direct include internal and not have indirect include direct and internal would be a bit disturbing. I would be one step close to have the nice total ⊂ indirect ⊂ direct ⊂ internal, somewhat frustrating. |
Here is how existing modes would translate:
|
This decision can of course be challenged, especially in the light that some people like @lcobucci think it should be ok for a package to deprecate calls from outside, while expecting no error when calling something deprecated internally, see doctrine/orm#6728 (comment)
|
… (greg0ire) This PR was merged into the 4.3-dev branch. Discussion ---------- [PhpUnitBridge] Url encoded deprecations helper config | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #28048 | License | MIT | Doc PR | symfony/symfony-docs#10701 First stab at implementing a new way of configuring the deprecation error handler. Includes a refactoring to keep things manageable. Rework of #24867, blocked by #29718 TODO: - [x] make the code 5.5 compatible 😢 - [x] add more tests - [x] deprecate modes (using echo :P) - [x] test this on real life projects and add some screenshots - [x] docs PR - [x] handle `strict` - [x] adapt existing CI config # Quiet configuration  # Default configuration  Commits ------- 1c73f9c [PhpUnitBridge] Url encoded deprecations helper config
…ire, llaakkkk) This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #11323). Discussion ---------- Document changes in the deprecation error handler See symfony/symfony#29211 See symfony/symfony#28048 Closes #10701 Commits ------- 64141fc fixup! Document changes in the deprecation error handler dd7eb0b fixup! Document changes in the deprecation error handler b2a7744 fixup! Document changes in the deprecation error handler 988badf fixup! Document changes in the deprecation error handler 2a750ea Document changes in the deprecation error handler
When a deprecation is thrown inside your very
src/
, you want it to always make your CI fail, don't you?I propose to update the behavior of the
SYMFONY_DEPRECATIONS_HELPER=123456
mode to make it mean:This would be a more powerful alternative to
weak_vendor
, which could be deprecated.WDYT?
(#27006 could converge with this RFC I suppose.)
The text was updated successfully, but these errors were encountered: