[VOTE] PSR-2 Multi-Line Argument Errata

591 views
Skip to first unread message

Phil Sturgeon

unread,
Sep 16, 2013, 10:09:35 AM9/16/13
to php...@googlegroups.com
Unless you've been offline for 6 weeks you've probably seen me talking about Errata and PSR-2 Multi-Line Arguments.

This conversation started long before I picked up the torch, and has been well and truly spread around the internet. The VERY shortest answer is that CodeSniffer is very explicit about something many folks who helped write PSR-2 were never specific about. Here is a write-up which should explain the problem clearly.

It was brought up on the FIG CS ML a while ago and has been posted as an issue on GitHub (showing that all existing FIG projects already use this style of handling multi-line arguments, so... we consider it valid already.

There was another conversation on the ZF2 GitHub issues, where again it was decided that usage of these multi-line arguments is fine (potentially misunderstood) but is within the intent of PSR-2. In that conversation Greg Sherwood of the CodeSniffer team says he'll be happy to make any changes to the official CodeSniffer rule-set if we change the documentation. Obviously we cant change PSR-2 itself, but we can add Errata. 

So.

Please vote +1 to merge this PR and add this Errata to PSR-2.

+1 from PyroCMS

Phil Sturgeon

unread,
Sep 16, 2013, 10:12:24 AM9/16/13
to php...@googlegroups.com
This vote will obviously close 2 weeks from now, which is: September 30th 2013, 14:00 UTC.

CalEvans

unread,
Sep 16, 2013, 10:17:31 AM9/16/13
to php...@googlegroups.com
+1

=C=

Fabien Potencier

unread,
Sep 16, 2013, 10:22:33 AM9/16/13
to php...@googlegroups.com
+1

On 9/16/13 4:09 PM, Phil Sturgeon wrote:
> Unless you've been offline for 6 weeks you've probably seen me talking
> about Errata
> <https://groups.google.com/forum/#!topic/php-fig/qTROKw07848> and PSR-2
> Multi-Line Arguments <https://github.com/php-fig/fig-standards/pull/178>.
>
> This conversation started long before I picked up the torch, and has
> been well and truly spread around the internet. The VERY shortest answer
> is that CodeSniffer is very explicit about something many folks who
> helped write PSR-2 were never specific about. Here is a write-up
> <https://gist.github.com/philsturgeon/6320152#file-multi-line-arguments-md> which
> should explain the problem clearly.
>
> It was brought up
> <https://groups.google.com/forum/#!msg/php-fig-cs/lmkXbO5VHWw/jlD1FVpQwIgJ>
> on the FIG CS ML a while ago and has been posted as an issue on GitHub
> <https://github.com/php-fig/fig-standards/issues/61#issuecomment-12062271> (showing
> that all existing FIG projects already use this style of handling
> multi-line arguments, so... we consider it valid already.
>
> There was another conversation
> <https://github.com/zendframework/zf2/issues/4390> on the ZF2 GitHub
> issues, where again it was decided that usage of these multi-line
> arguments is fine (potentially misunderstood) but is within the intent
> of PSR-2. In that conversation Greg Sherwood of the CodeSniffer team
> says he'll be happy to make any changes
> <https://github.com/zendframework/zf2/issues/4390#issuecomment-23198573>
> to the official CodeSniffer rule-set if we change the documentation.
> Obviously we cant change PSR-2 itself, but we can add Errata.
>
> So.
>
> Please vote +1 to merge this PR and add this Errata to PSR-2.
>
> *+1 from PyroCMS*
>
> --
> 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 php-fig+u...@googlegroups.com.
> To post to this group, send email to php...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/php-fig/8a6fc058-a9a7-46e6-b61f-6accf8b11b62%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Drak

unread,
Sep 16, 2013, 10:57:33 AM9/16/13
to php...@googlegroups.com
+1


--

Jordi Boggiano

unread,
Sep 16, 2013, 11:07:01 AM9/16/13
to php...@googlegroups.com
+1

William Durand

unread,
Sep 16, 2013, 11:08:24 AM9/16/13
to php...@googlegroups.com
+1

--
William Durand | http://www.williamdurand.fr


On Mon, Sep 16, 2013 at 5:07 PM, Jordi Boggiano <j.bog...@seld.be> wrote:
+1

--
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 php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.

Kris Wallsmith

unread,
Sep 16, 2013, 11:38:51 AM9/16/13
to php...@googlegroups.com

Pádraic Brady

unread,
Sep 16, 2013, 3:23:24 PM9/16/13
to php...@googlegroups.com
+1 from Zend Framework obviously



For more options, visit https://groups.google.com/groups/opt_out.



--

--
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
Zend Framework Community Review Team
Zend Framework PHP-FIG Representative

Paul Dragoonis

unread,
Sep 17, 2013, 6:38:28 AM9/17/13
to php...@googlegroups.com

Paul M. Jones

unread,
Sep 17, 2013, 12:51:34 PM9/17/13
to php...@googlegroups.com

On Sep 16, 2013, at 9:09 AM, Phil Sturgeon <em...@philsturgeon.co.uk> wrote:

> Please vote +1 to merge this PR and add this Errata to PSR-2.
>

What PR, exactly, are we voting on? Didn't notice the link above.


--
Paul M. Jones
pmjo...@gmail.com
http://paul-m-jones.com


Beau Simensen

unread,
Sep 17, 2013, 12:59:34 PM9/17/13
to php...@googlegroups.com
On Tuesday, September 17, 2013 11:51:34 AM UTC-5, pmjones wrote:
What PR, exactly, are we voting on? Didn't notice the link above.

I assume this: https://github.com/php-fig/fig-standards/pull/178 It was linked as "PSR-2 Multi-Line Arguments" in the original post.

Paul M. Jones

unread,
Sep 17, 2013, 1:05:21 PM9/17/13
to php...@googlegroups.com
If so, I must vote -1. The proper interpretation for the first example, IMO, is:


somefunction(
$foo,
$bar,
[
// ...
],
$baz
);

Phil Sturgeon

unread,
Sep 17, 2013, 1:47:55 PM9/17/13
to php...@googlegroups.com


On Tuesday, 17 September 2013 13:05:21 UTC-4, pmjones wrote:

On Sep 17, 2013, at 11:59 AM, Beau Simensen <sime...@gmail.com> wrote:

> On Tuesday, September 17, 2013 11:51:34 AM UTC-5, pmjones wrote:
> What PR, exactly, are we voting on? Didn't notice the link above.
>
> I assume this: https://github.com/php-fig/fig-standards/pull/178 It was linked as "PSR-2 Multi-Line Arguments" in the original post.

If so, I must vote -1.  The proper interpretation for the first example, IMO, is:


That is A valid expression, if you wish to spread the argument list over multiple lines. The results of the recent poll show that the majority of the group consider the example to be valid. 

Mike van Riel

unread,
Sep 17, 2013, 2:00:09 PM9/17/13
to php...@googlegroups.com
+1
--
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 php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.

Leo Feyer

unread,
Sep 18, 2013, 3:13:54 AM9/18/13
to php...@googlegroups.com
+1

Voting membership is still pending approval, so feel free not to count my vote.

Karsten Dambekalns

unread,
Sep 18, 2013, 3:20:44 AM9/18/13
to php...@googlegroups.com
Hi.

On 16. September2013 at 16:09:45 , Phil Sturgeon (em...@philsturgeon.co.uk) wrote:
>Please vote +1 to merge this PR and add this Errata to PSR-2.

+0 from TYPO3 Flow on https://github.com/php-fig/fig-standards/pull/178

Regards,
Karsten


Lukas Kahwe Smith

unread,
Sep 18, 2013, 1:56:39 PM9/18/13
to php...@googlegroups.com

On Sep 16, 2013, at 16:12 , Phil Sturgeon <em...@philsturgeon.co.uk> wrote:

> This vote will obviously close 2 weeks from now, which is: September 30th 2013, 14:00 UTC.

+1 from Jackalope

regards,
Lukas Kahwe Smith
sm...@pooteeweet.org



signature.asc

André R.

unread,
Sep 19, 2013, 3:25:36 AM9/19/13
to php...@googlegroups.com
+ from eZ Publish

IF the code snippet "'Hello '.$app->escape($name)" is either not using string concatenation or gets some space to become "'Hello ' . $app->escape($name)".

Phil Sturgeon

unread,
Sep 19, 2013, 10:48:53 AM9/19/13
to php...@googlegroups.com


On Thursday, 19 September 2013 03:25:36 UTC-4, André R. wrote:
+ from eZ Publish

IF the code snippet "'Hello '.$app->escape($name)" is either not using string concatenation or gets some space to become "'Hello ' . $app->escape($name)".

 I'll be doing a follow-up vote to change that code to just // ... to avoid anyone getting confused. We've already had comments about "is this the one true way to concatenate"... ugh.

Larry Garfield

unread,
Sep 20, 2013, 12:22:32 AM9/20/13
to php...@googlegroups.com
+1

--Larry Garfield, Drupal

Phil Sturgeon

unread,
Sep 30, 2013, 12:10:02 PM9/30/13
to php...@googlegroups.com
Voting is closed.

For: 11
Against: 1
Abstain: 1

At the time the vote started we had 27 members so we've passed the quorum and the vote has passed. 

I've merged the Pull Request and I'll get in touch with Greg to get this errata reflected in an upcoming version of CodeSniffer. 

Pádraic Brady

unread,
Sep 30, 2013, 7:42:24 PM9/30/13
to php...@googlegroups.com
Thanks for tackling these, Phil!

Pádraic Brady
--
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 php-fig+u...@googlegroups.com.
To post to this group, send email to php...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages