Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm 9 align assignments in PHP

Tags:

phpstorm

After many searches, it seems I don't have the option to align consecutive assignments of variables in PHP. I can align key/value pairs in arrays, but that's it.

It also seems older PHPStorm versions have it.

Is that possible in PHPStorm 9 ? If so, how ? If not, is it really much better than older versions ? I just started using it (coming from Sublime).

This is an example of non formatted code :

$sExample = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast = 'ENOUGH !';

And that's the format result :

$sExample        = 'Example !';
$sAnotherOneHere = 'Again ?';
$sAndTheLast     = 'ENOUGH !';
like image 835
Steve Chamaillard Avatar asked Sep 25 '15 17:09

Steve Chamaillard


1 Answers

The option is still there and it works flawlessly.

Search for it under Editor -> Code Style -> PHP -> Wrapping and Braces -> Assignment Statement. It's called "Align consecutive assignments".

like image 187
axiac Avatar answered Dec 01 '22 21:12

axiac