Yes, in principle we can control the line breaks. But in this case I'm not sure if it's the correct way to go. We have always used PSR / PER as guidance when making formatting decisions, but we never aimed to be fully PSR / PER compliant. Probably there are many more examples for this. To me, the idea behind this plugin is to stay reasonably close to how Prettier for JS works. What do you think @cseufert?
@KorvinSzanto Thanks for the heads-up! @cseufert Should we call it PER then? 🙈
Hi @deakjahn, thanks for bringing this up. As far as I can tell, a public API for this use-case has not been a focus yet. If I'm not mistaken, the functions in the
src/ast directory are node constructors, though. The parser itself creates them like this: https://github.com/glayzzle/php-parser/blob/main/src/ast.js#L393 - you're looking for something typed though, right?
chore(release): 6.1.1 [skip ci]