I am working in a Symfony project, using PhpStorm and I have selected 'Symfony 2' as the preset to reformat code.
However the rest of the codebase has the following style:
$updatesTable->addRow([
$company->getName(),
$company->getId(),
$company->getWebsite(),
$amendedWebsite,
]);
But when I reformat my code, it looks like this:
$updatesTable->addRow(
[
$company->getName(),
$company->getId(),
$company->getWebsite(),
$amendedWebsite,
]
);
I can't see anywhere in settings to change it and there doesn't seem to be duplicate questions about it.
What setting do I have to adjust to match my code to the existing code?
Edit - xml settings:
<code_scheme name="Default" version="173">
<option name="LINE_SEPARATOR" value=" "/>
<PHPCodeStyleSettings>
<option name="CONCAT_SPACES" value="false"/>
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" 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="VARIABLE_NAMING_STYLE" value="CAMEL_CASE"/>
<option name="BLANK_LINES_BEFORE_RETURN_STATEMENT" value="1"/>
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true"/>
</PHPCodeStyleSettings>
<codeStyleSettings language="PHP">
<option name="BLANK_LINES_AFTER_PACKAGE" value="1"/>
<option name="ALIGN_MULTILINE_PARAMETERS" value="false"/>
<option name="CALL_PARAMETERS_WRAP" value="5"/>
<option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true"/>
<option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true"/>
<option name="METHOD_PARAMETERS_WRAP" value="5"/>
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true"/>
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true"/>
<option name="ARRAY_INITIALIZER_WRAP" value="5"/>
<option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true"/>
<option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true"/>
<option name="IF_BRACE_FORCE" value="3"/>
<option name="DOWHILE_BRACE_FORCE" value="3"/>
<option name="WHILE_BRACE_FORCE" value="3"/>
<option name="FOR_BRACE_FORCE" value="3"/>
</codeStyleSettings>
</code_scheme>
Here you go. For your code sample.
Code Style | PHP | Wrapping and Braces
Function/constructor call arguments
New line after '('
and Place ')' on new line
HINT: you can copy & paste your custom code into the preview area and see the changes live right there. It's not ideal (as it has very short line length (vertical line) so the code may wrap much sooner than in the Editor) but it helps in certain cases.