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

Cannot align concatenation #77

Closed
karchung0930 opened this issue May 27, 2024 · 3 comments
Closed

Cannot align concatenation #77

karchung0930 opened this issue May 27, 2024 · 3 comments

Comments

@karchung0930
Copy link

karchung0930 commented May 27, 2024

Let's say I have the following:

$first = '1';
$longer .= '2';
$longer .= '23;

It cannot align vertically. The expected result is:

$first   = '1';
$longer .= '2';
$longer .= '23;
@driade
Copy link
Owner

driade commented May 27, 2024

Thanks, interesting case, I'll check if we can modify the AlignEquals rule to consider this case.

@driade
Copy link
Owner

driade commented Jan 8, 2025

Hi @karchung0930 , while working on this I saw this old test in the package

https://github.com/driade/phpfmt8/blob/master/tests/Original/042-align_vars.out

It seems that if we go the way of aligning ".=" we'd take into consideration the rest of the operators listed in the test. I've to think if this would be a desired default behaviour for the parser or if I'd create another rule to match these cases.

@driade
Copy link
Owner

driade commented Jan 8, 2025

Hi @karchung0930 I finally created a new rule. You may check it soon when the repo syncs with SublimeText. The name of the rule is "AlignSuperEquals"

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

No branches or pull requests

2 participants