Format array()

Answered

I like array items being aligned by the =>

When I reformat code PhpStorm will align the items, but also indents everything approximately 1 mile to the left (even with spaces!).

Is it possible to adjust PhpStorm settings to get the end result like this: 

$mpdf = new \Mpdf\Mpdf([
'mode' => 'utf-8',
'format' => 'A4',
'tempDir' => $temp_dir,
'margin_left' => 25,
'margin_right' => 20,
'margin_top' => 27,
'margin_bottom' => 23,
]);

(But with tabs, instead of spaces)

Currently PhpStorm produces this:

$mpdf = new \Mpdf\Mpdf([
'mode' => 'utf-8',
'format' => 'A4',
'tempDir' => $temp_dir,
'margin_left' => 25,
'margin_right' => 20,
'margin_top' => 27,
'margin_bottom' => 23,
]);

2 comments
Comment actions Permalink

It seems that you have Wrapping and Braces | Function/constructor call arguments | Align when multiline enabled, that's what is causing the issue.

0
Comment actions Permalink

Yes, this was the setting I was looking for. Thanks!

0

Please sign in to leave a comment.