V
V
vrazbros2016-07-07 17:12:54
PHP
vrazbros, 2016-07-07 17:12:54

How to format an associative array in phpStorm?

How from such a heap?

'year'                                                            => $data['year'],
                'name' => $data['name'],
                'start' => $data['start'],
                'end' => $data['end'],
                'tier'           =>                                                      $data['tier'],
                                              'summary'                   => $data[''],

Make candy?
'year'         => $data['year'],
'name'       => $data['name'],
'start'        => $data['start'],
'end'          => $data['end'],
'tier'          => $data['tier'],
'summary' => $data['summary'],

formatting in this editor was not particularly successful, but I hope the idea is clear.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ArturArturov, 2016-07-07
@ArturArturov

Code -> Reformat Code (Ctrl + Alt + L)
did not help?

I
Ildar N, 2016-10-21
@radli

In the beginning, you need to enable this function in the settings
Settings -> Editor -> Code Style -> [Lang] -> Other tab -> Align key-value -> enable
And after that: Code -> Reformat Code (Ctrl + Alt + L )
And it should work!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question