Heim  >  Artikel  >  Backend-Entwicklung  >  php格式化工具Beautify PHP小小BUG_PHP教程

php格式化工具Beautify PHP小小BUG_PHP教程

WBOY
WBOYOriginal
2016-07-21 15:51:52909Durchsuche

Beautify PHP,很好用的php格式化工具
http://www.bierkandt.org/beautify/
http://pear.php.net/package/PHP_Beautifier/download

最近组内来新人,他们代码不太规范的时候看得实在不舒服

这个工具实在很好用,再乱的代码瞬间就格式化好了

丢到linux下还可以快速批量处理@.@

好了,以下是本帖主题:

Beautify PHP格式化符号时,遗漏了^=和&=判断,

在beautify_php.class.inc第426行,增加这两个符号

                       // add space before chars = 
                        if ($i > 0 AND !$this->_comment) {
                            if (($a[$i] == "=" OR $a[$i] == "" OR $a[$i] == "*")
                                AND preg_match("/([ |!|=|.||-|+|*|/|^|&]+)/", $a[$i-1]) == 0) {
                                $this->_outstr  = rtrim($this->_outstr)." ";
                            }
                        }

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/319047.htmlTechArticleBeautifyPHP,很好用的php格式化工具 http://www.bierkandt.org/beautify/ http://pear.php.net/package/PHP_Beautifier/download 最近组内来新人,他们代码不太规范的时...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn