Code-style: multi-line return not indented
I am having trouble with the code formatting when there is a multi-line return statement, e.g.
return $this->isSomething() &&
$this->hasSomethingElse() &&
$this->isThisTrue();
The formatter always creates the following:
return $this->isSomething() &&
$this->hasSomethingElse() &&
$this->isThisTrue();
Can I tell it to keep the indent for such lines?
Thanks!
请先登录再写评论。
Hello,
Please enable option File | Settings | Editor | Code Style | PHP > Wrapping and Braces > Binary Expressions > Align when multiline.
Thanks for your response!
This works as a "workaround" I suppose.
It also looks to me that there is an issue with "Continuation indent"? The multi-line alignment creates (potentially) more indentations than specified as continuation indent:
This is using 8 spaces as indent.
With the setting "Align when multiline" it gets aligned to 7 spaces:
But my expectation would be to get 4 spaces as defined as the continuation indent:
Or do I misunderstand continuation indent? The sample in the settings does work for the sample code
Thanks in any case!