phpphp-beautifier

How do I fix PHP_Beautifier's empty lines?


I am currently using PHP_Beautifier for formatting code with the following command like options

-t -l "ArrayNested() IndentStyles(style=bsd) NewLines(before=T_CLASS:function:T_COMMENT,after=T_COMMENT)"

It works great except for the fact that it strips out all the blank lines. After a bit of searching, I found it posted as a bug that is open since 2007.

I tried looking into the codebase but was unable to locate the specific code that does this. I appreciate any help I can get in the right direction.


Solution

  • I'm clbustos, the developer of PHP_Beautifier. This is one of the most requested features, so I expected to implement it on the next release. If you want to dig, the function to see if PHP_Beautifier::removeWhitespace