-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve deprecation messages #3768
Improve deprecation messages #3768
Conversation
983e624
to
9fae3bb
Compare
src/AbstractFixer.php
Outdated
'Passing NULL to set default configuration is deprecated and will not be supported in 3.0, use an empty array instead.', | ||
E_USER_DEPRECATED | ||
); | ||
Application::triggerDeprecation('Passing NULL to set default configuration is deprecated and will not be supported in 3.0, use an empty array instead.'); |
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.
please revert that part and keep only messages changed.
that's exactly the part I am confused about and I wanted to discuss about in "original" PR, while message of errors can be modified and merged separately.
Why thing why this can't be merged to 2.11 is that, with this static method (which cannot be mocked... nor nicely tested...) we started to throwing exception for every deprecation (with FUTURE_MODE), which is not acceptable for bugfix release
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.
I reverted Application::triggerDeprecation
but it didn't make all deprecation notices throw an exception with PHP_CS_FIXER_FUTURE_MODE
env var: it was only called where there already was PHP_CS_FIXER_FUTURE_MODE
check.
Though there are a few places that currently trigger a deprecation notice and should also have a PHP_CS_FIXER_FUTURE_MODE
but it's missing so I added it. I consider this a bugfix.
7517609
to
65d1ab8
Compare
13f0394
to
515b34b
Compare
Thank you @julienfalque. |
Extracted from #3699.