How to automate formatting of a PHP source?

I have a PHP project with large true versions (hundreds of files) that I was attracted to, and the original formatting was not very consistent from the start. Now I would like to use all the source code and format it in accordance with the Zend Framework coding standards (tabs in spaces, short tags in full php tags, indentation correction, etc.), however this is not a task that can be done manually. How can I automate this process?

+1
source share
2 answers

Try to find php code decoders. There phpCodeBeautifier, PHP_Beautifier (PEAR) and PHPed comes with PolyStyle.

+1
source

Eclipse has a code template that you can modify and apply. Its stupid to apply coding standards for spaces when you can run a tool to do it for you.

+1
source

Source: https://habr.com/ru/post/1742691/


All Articles