fix: make BinaryOperatorSpacesFixer work as pre-v3.47 - #7751
Conversation
…ple shifts occurs in single line (PHP-CS-Fixer#7593)" This reverts commit edce2ad.
BinaryOperatorSpacesFixer work as pre-v3.47 BinaryOperatorSpacesFixer work as pre-v3.47
|
@wadakatu no problem. The issue there was that the logic you added was not based on tokens, but on single string that represented the line of code. I should catch it before, so I believe it's my fault it went live. The fixer just can't do a regex replacements on full string because - as reported snippets show - it may replace "operator" found inside a string. It must iterate through tokens and modify whitespace around actual operator. |
|
I did not think about it, to be fair, but it seems like a good idea. It isn't done yet, but how would you like to achieve it? These particular failures were strictly related to the invalid implementation which was reverted. Of course, we can add these reported snippets, but it does not cover every possible case.. 🙂 |
This is what I had in mind. I know it's done in PHPStan codebase, every single issue is added as a test case |
Revert of #7593
Fixes #7745
Fixes #7748