I have code that looks like this:
function processRequest() {
// get the verb
$method = strtolower($_SERVER['REQUEST_METHOD']);
switch ($method) {
case 'get':
handleGet();
break;
case 'post':
handlePost();
// $data = $_POST;
break;
case 'delete':
handleDelete();
break;
case 'options':
header('Allow: GET, POST, DELETE, OPTIONS');
break;
default:
header('HTTP/1.1 405 Method Not Allowed');
break;
}
}
PHP CodeSniffer complains about the indents of those case statements. In emacs with flymake it looks like this:
The message is:
error - Line indented incorrectly; expected 2 spaces, found 4 (PEAR.WhiteSpace.ScopeIndent.Incorrect)
Obviously CodeSniffer wants the case statements to be LESS indented than they are.
How can I tell CodeSniffer to allow my case statements to be indented the way I want them. Or better, to enforce that my case statements are indented this way?