github lkrms/pretty-php v0.4.22

latest releases: v0.4.72, v0.4.71, v0.4.70...
13 months ago

Changed

  • Adjust preservation of line breaks and blank lines

    • Don't preserve newlines after close braces that aren't structural (where "structural" essentially means "may enclose statements")
    • Collapse blank lines between list items and in other expression contexts (e.g. for loop expressions), including before comments
    • If one expression in a for loop is at the start of a line, add a newline before the others
  • Don't sort use <trait> statements

    Changing the order of traits inserted into a class changes the order its members are reported, so behaviour removed in v0.4.15 has been restored

  • When sorting imports, don't treat one-line comments as continuations if there is a change of type

  • If chained method calls would render as below, move the first call in the chain to the next line:

    // Before
    $foxtrot->foo(
        //
    )
        ->baz();
    
    // After
    $foxtrot
        ->foo(
            //
        )
        ->baz();

Don't miss a new pretty-php release

NewReleases is sending notifications on new releases.