I'm using Netbeans 7.1.1 with codesniffer. Whenever I have a case
statement I get indentation errors, e.g. for the following code:
switch ((int) $itemData['column_count']) {
case 4:
return 'grid-4columns';
case 6:
return 'grid-6columns';
default:
return '';
}
I get "Line indented incorrectly; expected 8 spaces, found 12" for every case
line. When I remove 4 spaces from those lines, e.g.
switch ((int) $itemData['column_count']) {
case 4:
return 'grid-4columns';
case 6:
return 'grid-6columns';
default:
return '';
}
I get errors "Line indented incorrectly; expected 12 spaces, found 8". Seems like codesniffer can't make up its mind, which is quite funny. The fun ends when my commits fail because of the codesniffer hook.
What is the problem with my case
indentation?
UPDATE: I have only one indentation rule in my ruleset:
<rule ref="Generic.WhiteSpace.ScopeIndent" />