github lkrms/pretty-php v0.4.79

8 hours ago

Changed

  • When strict-lists are enabled, always remove newlines before the first item in horizontal lists (not just when --psr12 is given)

  • Allow attributes to appear beside anonymous functions and arrow functions instead of moving them to separate lines (see example below)

  • When align-fn is enabled, align arrow function expressions with static instead of fn in static fn expressions:

    <?php
    // Before
    $foo = bar($baz, fn() =>
                         foo($bar));
    $foo = bar($baz, static fn() =>
                                foo($bar));
    $foo = bar($baz,
        #[Foo]
        static fn() =>
                   foo($bar));
    $foo = static fn() =>
                      foo($bar);
    
    // After
    $foo = bar($baz, fn() =>
                         foo($bar));
    $foo = bar($baz, static fn() =>
                         foo($bar));
    $foo = bar($baz, #[Foo] static fn() =>
                         foo($bar));
    $foo = static fn() =>
               foo($bar);
  • Refactor to reduce memory consumption

Don't miss a new pretty-php release

NewReleases is sending notifications on new releases.