Search code examples
phpphpstorm

PhpStorm align arguments of consecutive function calls


Is this possible?

Currently:

$foo->foobar($arg1, $arg2, $arg3);
$foo->foobar($argument1, $argument2, $argument3)
$foo->foobar($string1, $int1, $bool1)

What I want is:

$foo->foobar($arg1,      $arg2,      $arg3);
$foo->foobar($argument1, $argument2, $argument3)
$foo->foobar($string1,   $int1,      $bool1)

Particularly useful for PDO bindValue assignments. I've tried most of the alignment options in Function/Constructor call arguments.


Solution

  • Not currently possible / PhpStorm does not have this particular formatting functionality.

    https://youtrack.jetbrains.com/issue/WI-12233 -- watch this ticket (star/vote/comment) to get notified with any progress. So far it does not have much interest from the community.


    P.S. Perhaps one of the supported external formatters can do it (PHP CS Fixer or PHP Code Beautifier and Fixer)?