Given the following code:

<?php

function foo_block_view($delta) {
  $block = array();
  switch ($delta) {
    case 'foo_login_footer': {
      $block['content'] = $content;
    }
  }

  return $block;
}

the coder has trouble fixing the syntax.

Processing foo.php [PHP => 64 tokens in 12 lines]... DONE in 13ms (4 fixable violations)
=> Fixing file: 1/4 violations remaining [made 50 passes]... ERROR in 1.1 secs

Testing command: phpcbf --standard=Drupal foo.php

Comments

kenorb created an issue. See original summary.

klausi’s picture

Title: Too many passes for switch/case syntax. » phpcbf fails with uncommon switch/case :{} syntax

Hm, that are some weird braces in their after the "case:" statement. I didn't even know that this is valid PHP syntax. It does not appear at http://php.net/manual/en/control-structures.switch.php , so is this a hidden feature of PHP that works by accident?

Not sure we should invest time to make this work since this syntax is so rare. Feel free to provide a patch aynway!