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

Lobzek commented on NETBEANS-3391:
----------------------------------

Same for methods and functions declaration. 
[https://www.php-fig.org/psr/psr-12/#45-method-and-function-arguments]

It's impossible to make NetBeans format such code correctly:
{code:php}
class ReturnTypeVariations
{
    public function functionName(int $arg1, $arg2): string
    {
        return 'foo';
    }

    public function anotherFunction(
        string $foo,
        string $bar,
        int $baz
    ): string {
        return 'foo';
    }
}
{code}

> Support PSR-12 valid formatting rules
> -------------------------------------
>
>                 Key: NETBEANS-3391
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-3391
>             Project: NetBeans
>          Issue Type: Improvement
>          Components: php - Formatting & Indentation
>    Affects Versions: 11.1, 11.2
>            Reporter: Johannes
>            Assignee: Junichi Yamamoto
>            Priority: Trivial
>
> Please add options to allow for PSR-12 valid formatting. (PRS-12:[ 
> https://www.php-fig.org/psr/psr-12/)|https://www.php-fig.org/psr/psr-12/]
> Currently there is no way to get netbeans accept the following code format:
>   
> {code:php}
> $array = ['a','b','c'];
> foreach(
>     array_filter($array, function ($a) {
>         return $a === 'b';
>     }) as $data
> ) {
>     //code
> }
> {code}
> Formatting the code removes the required indent:
> {code:php}
> $array = ['a','b','c'];
> foreach(
> array_filter($array, function ($a) {
>         return $a === 'b';
> }) as $data
> ) {
>     //code
> }
> {code}
> PSR-12 Rules:
>  - PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine
>  - PSR12.ControlStructures.ControlStructureSpacing.LineIndent



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

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

Reply via email to