Save the following as an. xml format
<code_scheme name="Default"> <PHPCodeStyleSettings> <option name="Align_key_value_pairs"Value="true"/> <option name="Align_phpdoc_param_names"Value="true"/> <option name="align_phpdoc_comments"Value="true"/> <option name="align_assignments"Value="true"/> <option name="comma_after_last_array_element"Value="true"/> <option name="Phpdoc_wrap_long_lines"Value="true"/> <option name="Lower_case_boolean_const"Value="true"/> <option name="Lower_case_null_const"Value="true"/> <option name="Else_if_style"Value="COMBINE"/> <option name="align_class_constants"Value="true"/> <option name="Keep_blank_lines_after_lbrace"Value="1"/> <option name="Force_short_declaration_array_style"Value="true"/> <option name="PHPDOC_USE_FQCN"Value="true"/> </PHPCodeStyleSettings> <codestylesettings language="JSON"> <indentOptions> <option name="indent_size"Value="4"/> </indentOptions> </codeStyleSettings> <codestylesettings language="PHP"> <option name="Line_comment_at_first_column"Value="false"/> <option name="Line_comment_add_space"Value="true"/> <option name="keep_blank_lines_in_declarations"Value="1"/> <option name="Keep_blank_lines_in_code"Value="1"/> <option name="Keep_blank_lines_before_rbrace"Value="0"/> <option name="Blank_lines_before_package"Value="0"/> <option name="Blank_lines_after_package"Value="1"/> <option name="align_group_field_declarations"Value="true"/> </codeStyleSettings></code_scheme>
Settings found inside: Editor-to-Code Style-PHP. Select Import XML on the right.
Set inside Search "Reformat", view shortcut keys, you can also set your own
Phpstorm PSR2 style. xml