-
-
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
New option to align arrows (binary_operator_spaces) #6716
Comments
I would really love to get that previous behaviour back... :( |
This is a kinda tricky question. Adding a new option was one of the three proposal but the issue is that it would make only sens for The logic inside is already different:
Also I don't find Moreover a specific rule about |
I understand, but all of a sudden the rule that we use got changed and I've got hundreds of files that "should" be updated. We really liked how the rule worked prior to this change btw. Is it possible to have multiple rules? One that supports the old behaviour and one that supports this new that you implemented? |
It is true that the previous behavior is not perfectly aligned, but that is preferable to us. We would appreciate having the option to provide 3.13.0 behavior. |
I wasn't able to reproduce the good behaviour by downgrading friendsofphp/php-cs-fixer but I was able to go back to desired functionality by downgrading laravel/pint so now I am a bit confused really. More details here: laravel/pint#135 |
The 3.13.1 update also completely wrecked our Laravel config files that are well scoped having /* */ blocks between the array values. Now there's just unintentional indentation everywhere. |
+1 vote for giving us the option of the old behavior for In addition to the OP report, I believe the new behavior is not working as intended for Recent diff after running php-cs-fixer 3.13.1: yield 'null customer' => [
- 'expected' => null,
- 'ourCustomer' => null,
+ 'expected' => null,
+ 'ourCustomer' => null,
];
yield 'no underlying user' => [
- 'expected' => null,
- 'ourCustomer' => Customer::seed(),
+ 'expected' => null,
+ 'ourCustomer' => Customer::seed(),
];
Configured array and 'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => [
'=>' => 'align_single_space_minimal',
]
], |
I've tested, and it is not expected behavior. v3.13.1 result: function test()
{
yield 'null customer' => [
'expected' => null,
'ourCustomer' => null,
];
yield 'no underlying user' => [
'expected' => null,
'ourCustomer' => Customer::seed(),
];
} |
Please take a look at #6724 and give your opinion about it (especially the name of the options). It should satisfy everyone.
Thanks for the report, it will also be fixed in the #6724 PR |
Functionality of v3.13.0 should be preserved, and new option added to correspond v3.13.1 style. While this shouldn't be an issue for small snippets, but for config files where they are more likely to be spaced with newlines this change is crucial, and makes readability hell. |
Please try the new 3.14 release and tell me if this is ok now. |
Thanks everyone, from my end this looks "fixed" (or back to how it was in 3.13.1) ❤️ |
@VincentLanglet awesome, thanks |
Feature request
I would like the option for the behavior in v3.13.0
binary_operator_spaces
align_single_space_minimal
for arrays.Ref: #6590
config:
v3.13.0 result:
v3.13.1 result:
The text was updated successfully, but these errors were encountered: