phpfmt8 icon indicating copy to clipboard operation
phpfmt8 copied to clipboard

Cannot align concatenation

Open karchung0930 opened this issue 1 year ago • 1 comments

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;

karchung0930 avatar May 27 '24 09:05 karchung0930

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

driade avatar May 27 '24 09:05 driade

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 avatar Jan 08 '25 13:01 driade

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"

driade avatar Jan 08 '25 17:01 driade