I'm using Apatana's formatting features in PHP documents, it works well except with arrays where it transform this:
$data = array(
'email' => $params['email'],
'username' => $params['username'],
);
into this:
$data = array('email' => $params['email'], 'username' => $params['username']);
is there a way to avoid this and set custom formatting rules?
Yes. There is a way.
Go to the Studio's preferences and locate the 'Formatter' item. If you are using the default formatter profile, create a new one by clicking the '+' icon.
Click to edit the PHP formatting setting (double-click the 'PHP' item, or click it and than click the 'Edit' button).
Under the 'New Lines' tab, check the option to 'Insert new line between array-creation elements'. OK the dialogs. Make sure that the profile you just created is the selected one in the formatter preferences page, and format your code.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With