PHP_Beautifier
| From: | Jeff Kowalczyk | Date: | Tue, 25 Jul 2006 16:34:01 +0000 |
| Subject: | PHP_Beautifier | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-24759@lists.php.net to get a copy of this message | ||
I am very glad to find PEAR's PHP_Beautifier(-0.1.11). I hadn't expected
to find a capable and actively developed tool to perform some much needed
cleanup on a large PHP codebase.
The auto-generated documentation is not revealing the first question I
have:
How do I force a newline after every comma separated argument to a
function, array constructor, etc.
I want to strongly move this codebase toward vertical formatting, with
liberal use of newline rules to keep line length down.
This original formatting:
var $range_fields = Array(
'first_name',
'last_name',
'primary_address_city',
'account_name',
'account_id',
'id',
'email1',
'salutation',
'title',
'phone_mobile',
'reports_to_name',
'primary_address_street',
'primary_address_city',
'primary_address_state',
'primary_address_postalcode',
'primary_address_country',
'alt_address_city',
'alt_address_street',
'alt_address_city',
'alt_address_state',
'alt_address_postalcode',
'alt_address_country',
'office_phone',
'home_phone',
'other_phone',
'fax',
'department',
'birthdate',
'assistant_name',
'assistant_phone');
Cannot become this:
var $range_fields = Array('first_name', 'last_name',
'primary_address_city', 'account_name', 'account_id',
'id', 'email1',
'salutation', 'title', 'phone_mobile', 'reports_to_name',
'primary_address_street', 'primary_address_city',
'primary_address_state', 'primary_address_postalcode',
'primary_address_country', 'alt_address_city',
'alt_address_street',
'alt_address_city', 'alt_address_state', 'alt_address_postalcode',
'alt_address_country', 'office_phone', 'home_phone',
'other_phone',
'fax', 'department', 'birthdate', 'assistant_name',
'assistant_phone');
(which, as pasted, doesn't have any newlines)
Is there anywhere I can read/examine all the acceptable options to the
newlines filter?
php_beautifier -f file.php -o file.php.beautified \
--filters "NewLines(before=if:switch:T_CLASS,after=T_COMMENT:function)"
Thanks.