0

In PHPStorm, you can force arrays to be declared as [] in the "Code Style" section of Settings.

enter image description here

Is there anyway to do the opposite and force arrays to be declared with array()? For example, I would like the following:

$myArray = ['one', 'two'];

to become

$myArray = array('one', 'two');

when I reformat a script using the editor.

4

1 回答 1

1

There's an Intention for this: convert array

Unfortunately there's no way to have it performed automatically on "reformat code".

于 2017-12-27T11:07:21.040 回答