开发者

How do I automate the formatting of PHP source?

开发者 https://www.devze.com 2022-12-25 21:06 出处:网络
I have a large-ish PHP project (hundreds of files) that I\'ve been brought in to work on and the source formatting hasn\'t been very consistent from the beginning.I\'d now like to take all source and

I have a large-ish PHP project (hundreds of files) that I've been brought in to work on and the source formatting hasn't been very consistent from the beginning. I'd now like to take all source and format it according to the Zend Framework coding standa开发者_开发问答rds (tabs to spaces, short tags to full php tags, correct indenting, etc.), however this is not a job that can be done manually. How can I automate this process?


Try searching for php code beautifiers. There's phpCodeBeautifier, PHP_Beautifier (PEAR) and PHPed comes with PolyStyle.


Eclipse has a code template that you can modify and apply. Its silly to enforce coding standards for white space when you can run a tool to do it for you.

0

精彩评论

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