In my custom sniff I added
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2" />
<property name="tabIndent" value="false" />
</properties>
</rule>
Which works for functions and control structures within, but for instance
function test_plugin_admin_enqueue( $hook ) {
/**
* Load only on ?page=test-ajax-admin.php
* The easiest way to find out the hook name is to go to the
* options page and put print_r( $hook ); before the conditional.
*/
if ( $hook !== 'toplevel_page_test-ajax-admin' ) {
return;
}
wp_enqueue_script( 'test-plugin-admin-script', plugin_dir_url( __FILE__ ) . 'js/admin.js', array( 'jquery' ) );
}
the return
will have error Tabs must be used to indent lines, spaces are not allowed
.
Is there a way to check for correct spacing for that as well, while not using tabs, but only spaces?