Search code examples
phpstorm

Convert array to multiline based on keys in PhpStorm


Is there any way in PhpStorm to convert string

$arr = array('where' => '{"key_4":' . $this->key_4 . '}', 'key_2' => $this->user->key_2, 'key_3' => $this->user->key_5, 'key_6' => '');

into

$arr = array(
    'where' => '{"key_4":' . $this->key_4 .'}',
    'key_2' => $this->user->key_2, 
    'key_3' => $this->user->key_5, 
    'key_6' => ''
);

Has anyone some ideas?


Solution

  • These are the only changes that I've done in Default scheme to get such formatting:

    enter image description here

    Results (before and after):

    enter image description here