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

NoSuperfluousConcatenationFixer replaces double quotes w single quotes #916

Open
BlueM opened this issue Sep 27, 2023 · 2 comments
Open
Labels

Comments

@BlueM
Copy link

BlueM commented Sep 27, 2023

On a code base I work on, I have this line:

printf('"%s";"%s";"%s"'."\r\n", ...$line);

When I enable NoSuperfluousConcatenationFixer, this is the resulting code:

printf("\"%s\";\"%s\";\"%s\"\r\n", ...$line);

So the fixer concatenated the strings, but as a side effect introduced ugly escaping due to the double quotes now being used. I can work around this in my codebase, but it would be even better to have a setting for the fixer which controls if concatenations are retained if the type of quotes would have to be changed. In this case, such a setting would leave the code as-is.

(Apart from that: great tool.)

@kubawerlos
Copy link
Owner

Hi @BlueM,

it seems like a nice improvement, would you like to raise PR with such a feature?

@BlueM
Copy link
Author

BlueM commented Oct 30, 2023

So far, I haven’t even tried to understand how php-cs-fixer or your fixers work. Therefore, this would probably be a challenge for me, but at least I could try. But it will take a while, especially as I know that I won’t have time for this within the next six to eight weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants