Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 of 9 tasks
lkrms opened this issue Jan 21, 2025 · 0 comments
Open
5 of 9 tasks

Comments

@lkrms
Copy link
Owner

lkrms commented Jan 21, 2025

  • 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) {
            ;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant