[ 
https://issues.apache.org/jira/browse/NETBEANS-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532964#comment-16532964
 ] 

Bo Andersen commented on NETBEANS-471:
--------------------------------------

I have just checked with "Build incubator-netbeans-release-302-on-20180517", 
and the example from 
[PSR-2|https://www.php-fig.org/psr/psr-2/#44-method-arguments]:

 
{code:java}
<?php
namespace Vendor\Package;

class ClassName
{
    public function aVeryLongMethodName(
        ClassTypeHint $arg1,
        &$arg2,
        array $arg3 = []
    ) {
        // method body
    }
}
{code}
 and the mentioned configuration set to "New line", the result is:
{code:java}
class ClassName
{

  public function aVeryLongMethodName(
    ClassTypeHint $arg1,
    &$arg2,
    array $arg3 = []
    )
    {
      // method body
    }
}
{code}
In this case, there should be no formatting. ") {" should be on the same line 
(see above link to PSR-2)

 

> PSR.2 formatting 
> -----------------
>
>                 Key: NETBEANS-471
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-471
>             Project: NetBeans
>          Issue Type: Bug
>          Components: php - Formatting &amp; Indentation
>            Reporter: Bo Andersen
>            Priority: Minor
>
> Formatting is not following PSR-2 regarding curly braces on function 
> declarations,  please see 
> [https://www.php-fig.org/psr/psr-2/#44-method-arguments|https://www.php-fig.org/psr/psr-2/#44-method-arguments]
>  
> {code:java}
> class ClassName {
>   public function aVeryLongMethodName(
>    ClassTypeHint $arg1,
>    &$arg2,
>    array $arg3 = []) { // Should move the parenthesize and curly brace to the 
> next line
>  }
>   public function myMethod() { // Only the curly brace should be on next line
>   }
> }
> {code}
>  
> This is tested on Build incubator-netbeans-release-205-on-20180202.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to