PHP-Netbeans: how to change formatting for statements with multiple conditional expressions

I have the following code:

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

And after netbeans formats it, I get

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

what I do not want.

I have already tried changing the editor> Formatting> PHP> Wrapper> If Statement - but I could not even figure out what this parameter does, but at least it does not solve my problem.

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

+5
source share
1 answer

Netbeans has changed the syntax a bit. You need to break the line at the end of the AND statement instead of the previous one, and it will save breaks after the format.

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

All Articles