github lkrms/pretty-php v0.4.28

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

Changed

  • Revert change to logical operator placement in v0.4.27

    This change was intended to improve the readability of PSR-12-compliant control structure expressions, but output was inconsistent and there were unforeseen side-effects, so v0.4.26 behaviour has been restored. Apologies for the disruption!

  • In strict PSR-12 mode, move comments beside the closing brace of classes, interfaces, etc. to the next line

  • Move multi-line docblocks beside code to their own line

  • When adding blank lines before statements, respect continuation of earlier comments

  • Remove blank lines between subsequent one-line declare statements

  • For vertical spacing purposes, treat consecutive property declarations as the same declaration type, regardless of syntax (e.g. when var is mixed with private)

Fixed

  • Fix issue where blank lines are added after <?php when there are two or more subsequent declarations of the same type

  • If subsequent declaration types are different, propagate spacing from earlier siblings of the same type to avoid output like the following (there should be a blank line between class B and class C):

    <?php
    class A
    {
        public function a() {}
    }
    
    class B {}
    class C {}
  • Add blank lines before comments that trigger vertical expansion of declarations, preventing output like:

    <?php
    class A
    {
        public $foo;
        public $bar;
        // There should be a blank line above this
        public $baz;
    
        public $qux;
    }

Don't miss a new pretty-php release

NewReleases is sending notifications on new releases.