-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,13 @@ if (!file_exists(__DIR__.'/src')) { | |
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PHP71Migration' => true, | ||
'@PHPUnit75Migration:risky' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@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, | ||
'combine_nested_dirname' => true, | ||
'list_syntax' => ['syntax' => 'short'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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. |
||
'visibility_required' => ['property', 'method', 'const'], | ||
'ternary_to_null_coalescing' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder( | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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 definitionwhat 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 constantsUh oh!
There was an error while loading. Please reload this page.
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