Skip to content

Consider changes to code style inspired by review of PHP Parser test fixtures #199

Description

@lkrms
  • Don't move comments to the other side of empty statements?

  • Relax enforcement of class attributes on their own line when the class is a one-line and/or anonymous class?

  • Expand this

    <?php
    [
        $foo,,,
        $bar,
        $baz,
    ] = $data;

    to this?

    <?php
    [
        $foo,
        ,
        ,
        $bar,
        $baz,
    ] = $data;
  • Improve tag indentation in this scenario:

    <?php
    function test() {
        ?>
    Test
        <?php
    }
  • Suppress .0 in floats with an exponent, e.g. 3.0e5?

  • Remove leading space from & in fn &() => null for consistency with fn() => null

  • Check formatting of declare blocks without braces

  • Review switch indentation? e.g.

    <?php
    switch ($a) {
        case 0:
            break;
            // Deindent this after `break`/`return`/`throw`?
        case 1:
        default:
            break;
    }
  • Handle leading semicolons in switches

    <?php
    switch ($a) {
            ;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions