Introducing PHP-Styler: A Better Pretty-Printer for PHP-Parser
The article introduces PHP-Styler, a companion tool for PHP-Parser that allows developers to reconstruct PHP code from its abstract syntax tree (AST) with a standardized formatting style. Unlike other coding style fixers, PHP-Styler gives developers more control over the output by allowing them to apply their own style rules. The tool includes features such as control over brace placement, space after ! conditions, and line-splitting logic for long statements. Although there are still some formatting issues to address, PHP-Styler has been tested against multiple codebases and has shown surprisingly acceptable results. If you are using PHP-Parser and looking for a better pretty-printer or an alternative to PHP-CS-Fixer, PHP-Styler is worth a try.