Answer the question
In order to leave comments, you need to log in
How to implement array autoformatting in phpStorm?
Hello.
Please tell me how to implement auto-formatting of an array. Hello example, array before formatting:
public function rules()
{
return [
'name' => 'required|min:3|max:55',
'email_test' => 'required|unique:users.email|min:3|max:55|email',
];
}
public function rules()
{
return [
'name' => 'required|min:3|max:55',
'email_test' => 'required|unique:users.email|min:3|max:55|email',
];
}
Answer the question
In order to leave comments, you need to log in
There is a similar topic , but the information is outdated.
I'm using PhpStorm 2021.1.1 and the item "Align key-value pairs" is not in the "other" tab (it doesn't exist at all), but in the "Wrapping and Braces" tab.
Summing up, in order to implement automatic formatting of indents in an array, you need to go to "Editor"->"Code Style"->"PHP", on the "Wrapping and Braces" tab, go down to the "Array initializer" item and set the "Align key-value" option pairs"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question