You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that when I try to pretty print code with PhpParser\PrettyPrinter\Standard that contains closures with the use clause it'll be printed without spaces after the use keyword:
We can't really satisfy everyone with the default behavior -- there's just too many different coding styles in active use. Even adding options is not feasible, because there are hundreds of individual items that may need configuration. My recommendation would be:
If you only want to adjust a few things, extend the respective method in the pretty printer.
If you want to have more precise control of the formatting, print using the default style and then run the result though one of the existing code formatting libraries, which already implement fine-grained options to control formatting.
I've noticed that when I try to pretty print code with
PhpParser\PrettyPrinter\Standard
that contains closures with theuse
clause it'll be printed without spaces after theuse
keyword:while I'd expect this:
I checked the documentation (http://php.net/manual/en/functions.anonymous.php) and they do use spaces after
use
so I was thinking if this is intentional or possibly available for PR.https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/PrettyPrinter/Standard.php#L556
The text was updated successfully, but these errors were encountered: