First of all I'd like to say this is a great module.

I'm wondering about the error:
Empty CASE statements are not allowed

The pattern of using empty CASE statements is pretty common, for example it it used extensively in Drupal core code.

For example in common.inc on line 594:

  switch ($code) {
    case 200: // OK
    case 304: // Not modified
      break;
    case 301: // Moved permanently
    case 302: // Moved temporarily
    case 307: // Moved temporarily
      call_function();
      break;
    default:
      $result->error = $status_message;
  }

I don't see anywhere in the Drupal Coding standards that mentions blank case statements, and I can't think of a nicer way to represent a switch statement such as the above. So I'm wondering if this error should be removed from code sniffer.

Thanks.

Comments

klausi’s picture

Status: Active » Fixed

Thanks for spotting this, I haven't thought of empty case statements that are actually useful. Fixed in this commit: http://drupalcode.org/project/drupalcs.git/commit/230cbbd

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.