kphp icon indicating copy to clipboard operation
kphp copied to clipboard

allowed trailing comma for function parameter lists and closure use lists

Open i582 opened this issue 5 years ago • 0 comments

RFC: https://wiki.php.net/rfc/trailing_comma_in_parameter_list RFC: https://wiki.php.net/rfc/trailing_comma_in_closure_use_list

These two changes are very similar, therefore, they are combined into a single PR.

Function parameter list example:

function foo(
  $arg,
  $arg2, // allowed
) {
    echo $arg . $arg2 . "\n";
}

Closure use list example:

$foo = function () use (
    $a,
    $b, // allowed
) {
   echo $a, $b;
};

The GenTree::gen_list function is rather complicated, so a description has been added for it for all possible variants of its use.

#290

i582 avatar Sep 11 '21 15:09 i582