Skip to content
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

Merged

Conversation

julienfalque
Copy link
Member

Extracted from #3699.

'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.');
Copy link
Member

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

Copy link
Member Author

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.

@julienfalque julienfalque force-pushed the improve-deprecation-messages branch 2 times, most recently from 7517609 to 65d1ab8 Compare May 19, 2018 13:12
@keradus keradus added this to the 2.11.2 milestone May 21, 2018
@keradus keradus force-pushed the improve-deprecation-messages branch from 13f0394 to 515b34b Compare May 21, 2018 10:56
@keradus
Copy link
Member

keradus commented May 21, 2018

Thank you @julienfalque.

@keradus keradus merged commit 515b34b into PHP-CS-Fixer:2.11 May 21, 2018
keradus added a commit that referenced this pull request May 21, 2018
This PR was squashed before being merged into the 2.11 branch (closes #3768).

Discussion
----------

Improve deprecation messages

Extracted from #3699.

Commits
-------

515b34b Improve deprecation messages
@julienfalque julienfalque deleted the improve-deprecation-messages branch May 21, 2018 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants