github lkrms/pretty-php v0.4.15

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

Changed

  • Group alias/import statements by use, use function, use const for PSR-12 compliance (previous order was use, use const, use function)
  • Sort trait imports
  • Tighten the criteria for a DocBlock to follow a blank line
  • Move every -> in a multi-line method chain to a new line
  • In align-chains, collapse the first object operator after tokens with fewer characters than a soft tab
  • In align-lists, don't allow close bracket placement to be the only reason a list is not aligned, and refine the criteria for aligning lists with nested brackets
  • Rewrite the align-assignments rule
    • Align multiple tokens per line
    • Vary context matching rules by token type, e.g. only align commas adjacent to comparable tokens over consecutive lines
    • Apply spacing to the previous or following token as needed, e.g. right-align numeric columns in data arrays
    • Allow aligned tokens to be separated by multiple lines when every inner line has a higher effective indentation level than the tokens
    • Ignore series of alignable tokens that would otherwise be split and aligned separately due to a disruption (e.g. a comment, or nested code at a lower indentation level)
    • Align statements in one-line switch cases (preserve-one-line must also be enabled)

Removed

  • Remove "preserve trailing spaces" option
  • Don't report unnecessary parentheses

Fixed

  • Track and report output position to fix inaccurate problem report locations

Don't miss a new pretty-php release

NewReleases is sending notifications on new releases.