Possible Duplicate:
Are there any free cmd-line scripts which can re-format PHP source-code?
I've been evaluating several coding standards fixers to run on our code. This is to perform some auto-fixing on legacy code which uses deprecated things like perl-style comments.
The most useful fixer I have used so far is php-tidy which is found here: http://phptidy.berlios.de/
This tries to conform to the PEAR standard, which is almost exactly what I need, except that I want non-hanging braces for control structures.
Can anyone point me a (linux-based) command-line tool that can apply a fixer to use the ANSI style of braces?:
function nice_brace()
{
if (isset($nicebrace))
{
// I like non-hanging braces
}
}
Rather than the PEAR/Zend style:
function ugly_brace() {
if (isset($ugly_brace)) {
// I find this code harder to read
}
}
Edit: For others looking for something similar, check this script out: https://raw.github.com/gist/366837/25713637b6f2f9e1ec63abf3233142765df4b931/phpbb-reformat.pl
Many thanks