You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The formatter automatically inserts a semicolon inside a string interpolation block. For example, a line like: Error moving file '{$file_name}' to folder: {$e->getMessage()}
is transformed into: Error moving file '{$file_name}' to folder: {$e->getMessage();}
Interestingly, this seems to manifest inconsistently depending on whether there are multiple such lines in the same file. If at least one line in the file already contains a semicolon when saving, the formatter seems to leave the others untouched. However, if all lines of this pattern (string interpolation with curly braces) lack the semicolon upon saving, the formatter then incorrectly adds the semicolon to all of them.
Expected Behavior
No semicolon should be added inside the braces, preserving the original (and valid) syntax: echo "Error moving file '{$file_name}' to folder: {$e->getMessage()}";
Thank you for looking into this!
The text was updated successfully, but these errors were encountered:
driade
added a commit
to driade/phpfmt8
that referenced
this issue
Jan 17, 2025
Description
The formatter automatically inserts a semicolon inside a string interpolation block. For example, a line like:
Error moving file '{$file_name}' to folder: {$e->getMessage()}
is transformed into:
Error moving file '{$file_name}' to folder: {$e->getMessage();}
Interestingly, this seems to manifest inconsistently depending on whether there are multiple such lines in the same file. If at least one line in the file already contains a semicolon when saving, the formatter seems to leave the others untouched. However, if all lines of this pattern (string interpolation with curly braces) lack the semicolon upon saving, the formatter then incorrectly adds the semicolon to all of them.
Expected Behavior
No semicolon should be added inside the braces, preserving the original (and valid) syntax:
echo "Error moving file '{$file_name}' to folder: {$e->getMessage()}";
Thank you for looking into this!
The text was updated successfully, but these errors were encountered: