rfc:list-syntax-trailing-commas

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:list-syntax-trailing-commas [2017/01/27 15:42]
sammyk Change status to voting
rfc:list-syntax-trailing-commas [2017/09/22 13:28] (current)
Line 3: Line 3:
   * Date: 2015-11-03 (discussion);​ 2017-01-27 (voting)   * Date: 2015-11-03 (discussion);​ 2017-01-27 (voting)
   * Author: Sammy Kaye Powers, me@sammyk.me   * Author: Sammy Kaye Powers, me@sammyk.me
-  * Status: ​Voting+  * Status: ​Implemented in PHP 7.2 (Grouped namepaces only)
   * First Published at: https://​wiki.php.net/​rfc/​revisit-trailing-comma-function-args,​ https://​wiki.php.net/​rfc/​trailing-comma-function-args   * First Published at: https://​wiki.php.net/​rfc/​revisit-trailing-comma-function-args,​ https://​wiki.php.net/​rfc/​trailing-comma-function-args
  
Line 163: Line 163:
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
  
-Each trailing comma list syntax ​would get its own vote and would require ​a 2/3 majority to pass.+Each trailing comma list syntax ​has its own vote and requires ​a 2/3 majority to pass.
  
  
-Allow trailing commas in...+==== Function/​method arguments (declarations & calls) ====
  
-<doodle title="​Function/method arguments (declarations ​calls)"​ auth="​SammyK"​ voteType="​single">​+<code php> 
 +// Function/​method arguments (call) 
 +fooCall( 
 +    $arg1, 
 +    $arg2, 
 +    $arg3, 
 +); 
 +     
 +// Function/​method arguments (declaration) 
 +function something( 
 +    FooBarBazInterface $in, 
 +    FooBarBazInterface $out, 
 +) : bool { 
 +
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in function/method arguments (declarations ​and calls)"​ auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
 </​doodle>​ </​doodle>​
  
-<doodle title="​Grouped ​namepaces"​ auth="​SammyK"​ voteType="​single">​+==== Grouped namepaces ==== 
 + 
 +<code php> 
 +<?php 
 +use Foo\Bar\{ 
 +    Foo, 
 +    Bar, 
 +    Baz, 
 +}; 
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in grouped ​namepaces"​ auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
 </​doodle>​ </​doodle>​
  
-<doodle title="​Interface ​implementations on a class" auth="​SammyK"​ voteType="​single">​+==== Interface implementations on a class ==== 
 + 
 +<code php> 
 +class Foo implements 
 +    FooInterface,​ 
 +    BarInterface,​ 
 +    BazInterface,​ 
 +
 +
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in interface ​implementations on a class" auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
 </​doodle>​ </​doodle>​
  
-<doodle title="​Trait implementations on a class" auth="​SammyK"​ voteType="​single">​+==== Trait implementations on a class ==== 
 + 
 +<code php> 
 +class Foo 
 +
 +    use 
 +        FooTrait, 
 +        BarTrait, 
 +        BazTrait, 
 +    ; 
 +
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in trait implementations on a class" auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
 </​doodle>​ </​doodle>​
  
-<doodle title="​Class member lists" auth="​SammyK"​ voteType="​single">​+==== Class member lists ==== 
 + 
 +<code php> 
 +class Foo 
 +
 +    const 
 +        A = 1010, 
 +        B = 1021, 
 +        C = 1032, 
 +        D = 1043, 
 +    ; 
 +    protected 
 +        $a = '​foo',​ 
 +        $b = '​bar',​ 
 +        $c = '​baz',​ 
 +    ; 
 +    private 
 +        $blah, 
 +    ; 
 +
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in class member lists" auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
 </​doodle>​ </​doodle>​
  
-<doodle title="Inheriting variables from the parent scope in anonymous functions"​ auth="​SammyK"​ voteType="​single">​+==== Inheriting variables from the parent scope in anonymous functions ==== 
 + 
 +<code php> 
 +$foo = function ($bar) use ( 
 +    $a, 
 +    $b, 
 +    $c, 
 +) { 
 + // . . .  
 +}; 
 +</​code>​ 
 + 
 +<doodle title="​Allow trailing commas in use lists for anonymous functions"​ auth="​SammyK"​ voteType="​single" closed="​true">
    * Yes    * Yes
    * No    * No
rfc/list-syntax-trailing-commas.1485531752.txt.gz · Last modified: 2017/09/22 13:28 (external edit)