The story:
- Magnus Rosenbaum wrote the original phptidy script.
- Eoin Gallagher modified it so that it conforms to the WordPress Coding Standards.
- scribu put Eoin's version on github, for convenience wp-phptidy.
- I modified according to my taste.
$ d-phptidy.php replace some-file.php
Complete documentation can be found on the phptidy home page: http://phptidy.berlios.de/
Modified to use spaces and code as below
class MyClass extends SomeClass
{
function __construct($arg1, $arg2)
{
// do something
}
function doJob($arg)
{
foreach ($variable as $vari) {
if ($vari == 1) {
// do this
}
elseif ($vari == 2) {
// do another
}
else {
// do new
}
}
do {
// this is do loop
} while ($check);
while ($check) {
// this is while loop
}
$array = array('Apple', 'Banana', 'Carrot');
}
}