This is a script I'm using to convert the correct brace style ([1]) to the phpbb one ([2]).
It only does the braces. There's probably a generic reformatter out there somewhere but 1) I'm too lazy to search for it, and 2) who knows whether it will change something other than braces.
It also kills whitespace from lines containing only whitespace, which is what my editor does.
http://gist.github.com/366837
Usage: phpbb-reformat.sh /path/to/file.php
[1]
Code: Select all
if (foo) {
bar;
} else {
baz;
}
Code: Select all
if (foo)
{
bar;
}
else
{
baz;
}