PHP identation of array elements Follow
Identation of php array() is killing me!
For example, when I write this:
PaperlessService::getInstance()->makePayment(array( $caret$ ));
And hit enter, I expect this:
PaperlessService::getInstance()->makePayment(array(
$caret$
));
However, I get this:
PaperlessService::getInstance()->makePayment(array(
$caret$
));
WTF? Is there anything I can do about it?
Please sign in to leave a comment.
Anyone? I'm having a hard time with this issue. :_|
Finally, I came across CodeStyle => Wrapping and Braces settings and now it looks almost perfect:
PaperlessService::getInstance()->makePayment(array(
$caret$
));
My settings:
Method call arguments:
Align when multiline false
New line after '(' false
Place ')' on new line true
Array initializer:
Align when multiline false
New line after '{' true
Place '}' on new line true
I'm still missing some conf to disable extra margin before $caret$ and closing brackets:
PaperlessService::getInstance()->makePayment(array(
$caret$
));
(notice that the braces are exactly under the first statement)
Do you mean an extra line feed? In any case please submit a feature request at http://youtrack.jetbrains.com.
No, I mean, unnecessary extra identation:
PaperlessService::getInstance()->makePayment(array(
$caret$
<!--extra ident, can't get rid of it-->));
I think it's related to this issue: http://youtrack.jetbrains.net/issue/WI-7471
it has been solved and if you get the latest EAP build, it will give you the following if you press Enter inside array():
<?php
function bar()
{
PaperlessService::getInstance()->makePayment(array(
<caret>
));
}
Hopefully that's what you want.
Yes! Absolutely. Phoenix Zerin put it much better than me)