PHP indentation on if statements without curly braces

PHP related: Is these any way to stop the reformatting on if/else statements without curly braces?

I have a piece of code like this:

if (!($var = $this->getSomeThings()) instance of SomeThing)
    $otherVar = $somethingElse($var)
    return $var

And it keeps push the $otherVar line behind the control function, even far beyond my set hardwrap limit.

1 comment
Comment actions Permalink

Try adjusting this at File | Settings | Editor | Code Style | PHP > Wrapping and Braces:

Keep when reformatting > Control statement in one line - disable

'if()' statement > 'else' on new line - enable


This way I can keep the code fragment this way:


The rest of the settings:


Please sign in to leave a comment.