Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
klausiHm, 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!