-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Simplify PHP CS Fixer config #39772
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
Simplify PHP CS Fixer config #39772
Conversation
'@PHPUnit75Migration:risky' => true, | ||
'php_unit_dedicate_assert' => ['target' => '5.6'], | ||
'array_syntax' => ['syntax' => 'short'], | ||
'fopen_flags' => false, | ||
'protected_to_private' => false, | ||
'native_constant_invocation' => true, |
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.
enabling the rules as-is is causing the rule to use strict => false
setting (ref https://cs.symfony.com/doc/rules/constant_notation/native_constant_invocation.html#strict )
when rule was introduced, on request of Sf, we set up strict => true
for Symfony ruleset.
if you prefer strict => false
, we can adjust the ruleset definition
what is your preference?
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.
we now decided to always add the leading \
to all constants
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.
ack, thanks for the confirmation
out of curiosity - what was the reason for this change?
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.
measurable perf difference if I recall well
'protected_to_private' => false, | ||
'native_constant_invocation' => true, | ||
'combine_nested_dirname' => true, | ||
'list_syntax' => ['syntax' => 'short'], |
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.
FYI we gonna incorporate it in PHP migration ruleset PHP-CS-Fixer/PHP-CS-Fixer#5428
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.
then let's remove this line too, and merge this PR after PHP-CS-Fixer/PHP-CS-Fixer#5428 is merged?
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.
we need to extend integration tests to reflect this change. can't promise it's done in few days.
that's why i decided to have PR to cleanup what's currently possible, and do further cleanup in future, when changes on PHP CS Fixer are done and when fabbot is updated
This comment has been minimized.
This comment has been minimized.
Thank you @keradus. |
same rules, just written in easier way