My understanding of PSR-2 (and 12) is only the second one is permitted.

*PSR-12 4.5*

> Argument lists MAY be split across multiple lines, where each subsequent 
> line is indented once. When doing so, the first item in the list MUST be on 
> the next line, and there MUST be only one argument per line.
>

With that said, the shorter arrays *can* be condensed to single line if 
they fit. So you could have:
SomeClass::someMethod(
    // also, 4-space indents ;)
    ['arg1' => 111],
    // Okay, but in my opinion starts to risk readability.
    ['arg2' => SomeClass::someMethod(['arg5' => 999])]
    ['arg3' => ['arg4' => 'zzz']]
);




On Thursday, 18 January 2018 10:56:53 UTC-5, Hrvoje A. wrote:
>
> // is this allowed or is it a personal preference?
>
>
> SomeClass::someMethod([
>   'arg1' => 111,
> ], [
>   'arg2' => SomeClass::someMethod([
>      'arg5' => 999
>   ]),
> ], [
>   'arg3' => [
>     'arg4' => 'zzz'
>   ]
> ]);
>
> //
> // vs all array notations must be in new line
> //
>
> SomeClass::someMethod(
>   [
>     'arg1' => 111,
>   ],
>   [
>     'arg2' => SomeClass::someMethod(
>       [
>         'arg5' => 999
>       ]
>     ),
>   ],
>   [
>     'arg3' => [
>       'arg4' => 'zzz'
>     ],
>   ]
> );
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/559639e1-60d2-4ef5-b38d-2d0b959cdde2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to