开发者

How do I use php_beautifier with PEAR Code Standards?

How do I use php_beautifier 开发者_JAVA技巧with PEAR Code Standards?


You have to use PHP_Beautifier_Filter_Pear instead of the default filter.

$oBeaut->addFilter('Pear',array('add_header'=>'php'));

Or from CLI

$ php_beautifier --filters "Pear(add_header=php)"

The PEAR filter will

  • Add 2 newlines after Break in switch statements. Break indent is the same of previous line
  • Brace in function definition put on a new line, same indent of 'function' construct
  • Comments started with '#' are replaced with '//'
  • Open tags are replaced with <?php
  • T_OPEN_TAG_WITH_ECHO replaced with <?php echo
  • With setting 'add_header', the filter add one of the standard PEAR comment header (php, bsd, apache, lgpl, pear) or any file as licence header.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜