开发者

How do I use php_beautifier with PEAR Code Standards?

开发者 https://www.devze.com 2023-02-08 12:25 出处:网络
How do I use php_beautifier 开发者_JAVA技巧with PEAR Code Standards?You have to use PHP_Beautifier_Filter_Pear instead of the default filter.

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

精彩评论

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