Community
Participate
Working Groups
Greetings everyone, The PHP Code Formatter doesn't allow you to force a new line before the closing parenthesis of a function/method call, although it allows you to do that on array initializers. If you get for example, the PSR-2 code style, it says that, on multi-line function calls, the closing parenthesis must be on its on line, indented to the opening call. So for example: CORRECT ------- $this->funcCall( $val1, $val2 ); WRONG ------- $this->funcCall( $val1, $val2); Unfortunately the formatter doesn't allow you to add the new line on method calls, although it has that option for array initializers.
As a related post, this is a bug fix for the same issue on the Java Formatter. It was fixed recently, but the options created are not part of the PDT Formatter. https://bugs.eclipse.org/bugs/show_bug.cgi?id=370540
Whiteout this fixed the formatter is useless. I've been using eclipse PDT for years now and never use formatter because of this single issue. An option should be added for the formatter to resolve this issue. It should be present for function calls Arguments and for Object allocation arguments. Those options have been added to the java formatter years ago and I am shocked it has not been fixed yet for PDT.