With six years of experience with PHP , I have been ‘blessed’ with working with code written by really lazy people , who just didn’t think it was important at all to indent their code or comment it or make the opening and ending curly braces align.
And sometimes our favorite FTP clients would add God knows why those silly annoying empty lines and the code would keep getting bigger and bigger.
And I am sure that I am not alone in my frustrations.
That is why is am writing this script which will try to take care of all that.
Basically it will try to achieve the following goals:
- Indent your code with tabs.
- Put a comment block at the start of class definitions or functions.
- Provide you with the facility to align curly brackets.
- Remove unwanted lines from the code.
- Put some spacing in blocks for improved readability.
- Replaces short open tags with proper <?php tags
- If a PHP block contains only one line , it will put the whole block in one line to improve readability.
Please provide your valuable feedback to improve this script. I will be soon releasing a full script which will clean the code in all PHP files in a directory. Stay tuned!
Comments