Suppose you have an array declared in the traditional literal style:
<?php$a=[array(1,[[1=>array(1,1=>[1])],1])];
You can detect all the traditional literal style declarations in your code and convert them into short style:
On the main menu, choose
Code | Run Inspection by Name, or press Ctrl+Shift+Alt+I.
In the pop-up frame that opens, start typing the inspection name Traditional syntax array literal.
As you type, the suggestion list shrinks to show the matching inspection only. Press ?.
The Specify Inspection Scope dialog box opens.
In the Inspection scope area, specify which files should be inspected.
To have the source code of the entire project inspected, select the
Whole Project option.
To run an inspection for the currently opened file, or the file(s)/folder(s) selected in the
Project view, select the
File/Module <name>
option.
To apply inspect code in a specific scope, select the
Custom scope option, then choose the desired scope from the drop-down
list or click the Browse button and
configure a new scope
in the Scopes dialog box.
To have test source files inspected too, select the Include test sources
check box.
Click OK to run the inspection.
The Inspection Tool Window opens showing the list of files where the traditional literal style declarations have been detected:
Click Convert array syntax to short. The code is updated as follows: