Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-04-03 Thread Ryan McCullagh via internals
This would make PHP more consistent. Please add this!

On Mon, Mar 30, 2020, at 12:32 PM, Guilliam Xavier wrote:
> On Sun, Mar 29, 2020 at 11:31 PM Jakob Givoni  wrote:
> >
> > Hi Rowan,
> >
> > On Sat, Mar 28, 2020 at 4:01 PM Rowan Tommins  
> > wrote:
> > >
> > > While I'd personally be fine with this change, I think we should
> > > understand why the previous proposal failed rather than just hoping the
> > > vote goes differently this time.
> >
> > I think you have a good point here.
> > I've only been around for a short time so I can't comment on historical 
> > reasons.
> > And though I agree the proposal is logical and consistent, I have this
> > nagging feeling in the back of my brain:
> > Are we encouraging functions with long lists of parameters so that
> > they need to be on their own lines?
> 
> Just to say, with descriptive names and type declarations (and now
> union types), even a method with just two or three parameters can need
> to be wrapped to keep lines below 120 characters ;) Maybe the RFC
> could include an example?
> 
> But I am curious too about why it failed last time.
> 
> -- 
> Guilliam Xavier
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-30 Thread Guilliam Xavier
On Sun, Mar 29, 2020 at 11:31 PM Jakob Givoni  wrote:
>
> Hi Rowan,
>
> On Sat, Mar 28, 2020 at 4:01 PM Rowan Tommins  wrote:
> >
> > While I'd personally be fine with this change, I think we should
> > understand why the previous proposal failed rather than just hoping the
> > vote goes differently this time.
>
> I think you have a good point here.
> I've only been around for a short time so I can't comment on historical 
> reasons.
> And though I agree the proposal is logical and consistent, I have this
> nagging feeling in the back of my brain:
> Are we encouraging functions with long lists of parameters so that
> they need to be on their own lines?

Just to say, with descriptive names and type declarations (and now
union types), even a method with just two or three parameters can need
to be wrapped to keep lines below 120 characters ;) Maybe the RFC
could include an example?

But I am curious too about why it failed last time.

-- 
Guilliam Xavier

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-29 Thread Jakob Givoni
Hi Rowan,

On Sat, Mar 28, 2020 at 4:01 PM Rowan Tommins  wrote:
>
> While I'd personally be fine with this change, I think we should
> understand why the previous proposal failed rather than just hoping the
> vote goes differently this time.

I think you have a good point here.
I've only been around for a short time so I can't comment on historical reasons.
And though I agree the proposal is logical and consistent, I have this
nagging feeling in the back of my brain:
Are we encouraging functions with long lists of parameters so that
they need to be on their own lines?
Personally I would probably never use this. But since the proposed
change sounds trivial, I have no strong feelings against it.

Best,
Jakob

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-28 Thread Rowan Tommins

On 26/03/2020 18:52, Nikita Popov wrote:

Hi internals,

This has been declined in the past, but I just keep making this mistake,
and believe it deserves reconsideration...

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

Nikita



Hi Nikita,

While I'd personally be fine with this change, I think we should 
understand why the previous proposal failed rather than just hoping the 
vote goes differently this time.


Specifically, this vote was only 3 years ago, and although it achieved a 
majority, was well short of the 2/3 requirement: 
https://wiki.php.net/rfc/list-syntax-trailing-commas#functionmethod_arguments_declarations_calls 




Notably, a followup RFC proposing only function *calls* allow trailing 
commas, passed a few months later, and includes this specific rationale: 
https://wiki.php.net/rfc/trailing-comma-function-calls#wait_didn_t_we_just_vote_on_this


> I was contacted by many “no” voters saying that they would have voted 
“yes” for function calls, but “no” for function declarations. ThisRFC 
proposes allowing a trailing comma in function call syntax only.


Looking back at the discussions from 2017, I can see a couple of people 
taking that position, but not expanding on it. Does anyone still hold 
that view, and want to explain why they feel that way?



Side-note - here's a quick timeline of related RFCs:

- Feb 2013: https://wiki.php.net/rfc/trailing-comma-function-args - 
function calls only, rejected 15:20
- Oct 2015: 
https://wiki.php.net/rfc/revisit-trailing-comma-function-args - 
withdrawn in favour of next RFC
- Nov 2015, voted Jan 2017: 
https://wiki.php.net/rfc/list-syntax-trailing-commas - function calls 
and parameters, rejected 24:20
- Oct 2017: https://wiki.php.net/rfc/trailing-comma-function-calls - 
function calls only, passed 30:10
- Mar 2020: https://wiki.php.net/rfc/trailing_comma_in_parameter_list - 
function parameters only...



Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-27 Thread Marcio Almada
>
> Hi internals,
>
> This has been declined in the past, but I just keep making this mistake,
> and believe it deserves reconsideration...
>
> https://wiki.php.net/rfc/trailing_comma_in_parameter_list
>
> Nikita

I have no idea why we failed to approve trailing comma over lists in general,
but this seems to be a step forward. My `git diff` says +1

Thanks,
Márcio

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-27 Thread Christoph M. Becker
On 27.03.2020 at 14:58, tyson andre wrote:

> I'd just like to add that 
> https://wiki.php.net/rfc/trailing_comma_in_parameter_list seems useful,
> especially now that PSR-12 is approved and 
> https://www.php-fig.org/psr/psr-12/#45-method-and-function-arguments 
> recommends that
> "When the argument list is split across multiple lines, the closing 
> parenthesis and opening brace MUST be placed together on their own line with 
> one space between them."
> (Previously, I don't think there was any attempt at standardizing a 
> recommendation of where the closing parenthesis should go)

The text is identical for PSR-2[1], and even PEAR CS[2] put it that way.

So, yes, I'm +1 here.

[1] 
[2] 

--
Christoph M. Becker

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-27 Thread tyson andre
Hi internals,

I'd just like to add that 
https://wiki.php.net/rfc/trailing_comma_in_parameter_list seems useful,
especially now that PSR-12 is approved and 
https://www.php-fig.org/psr/psr-12/#45-method-and-function-arguments recommends 
that
"When the argument list is split across multiple lines, the closing parenthesis 
and opening brace MUST be placed together on their own line with one space 
between them."
(Previously, I don't think there was any attempt at standardizing a 
recommendation of where the closing parenthesis should go)

```
class ClassName
{
public function aVeryLongMethodName(
ClassTypeHint $arg1,
&$arg2,
array $arg3 = []  // comma would be useful here when adding or removing 
in diffs
) {
// method body
}
}
```

- Tyson
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Ben Ramsey
> On Mar 26, 2020, at 13:52, Nikita Popov  wrote:
> 
> Hi internals,
> 
> This has been declined in the past, but I just keep making this mistake,
> and believe it deserves reconsideration...
> 
> https://wiki.php.net/rfc/trailing_comma_in_parameter_list
> 
> Nikita


Yes, please

Cheers,
Ben


signature.asc
Description: Message signed with OpenPGP


Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Larry Garfield
On Thu, Mar 26, 2020, at 1:52 PM, Nikita Popov wrote:
> Hi internals,
> 
> This has been declined in the past, but I just keep making this mistake,
> and believe it deserves reconsideration...
> 
> https://wiki.php.net/rfc/trailing_comma_in_parameter_list
> 
> Nikita

Endorse.

I don't think there's anything more to add, just "endorse".

--Larry Garfield

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Lynn
On Thu, Mar 26, 2020 at 7:52 PM Nikita Popov  wrote:

> Hi internals,
>
> This has been declined in the past, but I just keep making this mistake,
> and believe it deserves reconsideration...
>
> https://wiki.php.net/rfc/trailing_comma_in_parameter_list
>
> Nikita
>

This would be a great addition, my "duplicate line" thanks you! (and so I)

Regards,
Lynn


[PHP-DEV] [RFC] Allow trailing comma in parameter lists

2020-03-26 Thread Nikita Popov
Hi internals,

This has been declined in the past, but I just keep making this mistake,
and believe it deserves reconsideration...

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

Nikita