In the coding standards that I'm using we use 2 spaces for indentation
<!-- Tabs should represent 2 spaces. -->
<arg name="tab-width" value="2"/>
<!-- Set the default indent value and force spaces instead of tabs -->
<rule ref="WordPress">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent" />
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
<property name="tabIndent" value="false"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
Which is generally working fine, but if I have, for example this
<?php
class MyClass{
public function my_function() {
add_submenu_page(
'my-top-level-slug',
'My Custom Page',
'My Custom Page',
'manage_options',
'my-top-level-slug'
);
}
}
Where the arguments of the add_submenu_page()
functions are I am getting
Multi-line function call not indented correctly; expected 8 spaces but found 6
So the 'correct' would look like
<?php
class MyClass{
public function my_function() {
add_submenu_page(
'my-top-level-slug',
'My Custom Page',
'My Custom Page',
'manage_options',
'my-top-level-slug'
);
}
}
But that's 2 spaces too much. I found some issues on github, but didn't find a solution for this.
How to fix this?