PHP-Netbeans: How to change formatting for multi-conditional if statements

假如想象 提交于 2019-12-01 02:59:59

问题


I have the following Code:

if(
    condition1
    && condition2
    && condition3
) {
    // do something
}

And after having netbeans reformat it i get

if(
    condition1 && condition2 && condition3
) {
    // do something
}

which is not what I want.

I already tried changing Editor>Formatting>PHP>Wrapping>If Statement - but I could not even figure out what this option does, but at least it seems not to solve my issue.

How can I make netbeans format multiconditonal ifs as I like them (or just leave them as they are)?


回答1:


Netbeans has changed the syntax slightly. You'll need to do a line break at the end of the AND operator instead of before and it will retain the breaks after a format.

if(
    condition1 &&
    condition2 &&
    condition3
) {
    // do something
}


来源:https://stackoverflow.com/questions/15921766/php-netbeans-how-to-change-formatting-for-multi-conditional-if-statements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!