[PSR-12] Closure guidelines for anon classes

2018-04-23 Thread Greg Sherwood
Hi, I'm working on the PSR-12 standard for PHP_CodeSniffer. I have a question about this section: 8. Anonymous Classes > Anonymous Classes MUST follow the same guidelines and principles as > closures in the above section. Almost the entire closure section of PSR-12 is dedicated to argument

Re: [PSR-12] Spacing for INSTEADOF and AS in trait trait use blocks

2018-04-23 Thread Greg Sherwood
Yeah, it could. But when PSR-12 says to "take note of spacing" what is it referring to then? Does it just mean the indent? Does it mean spacing around the comma, or around the braces? The examples with "take note" style comments are used throughout PSR-2 and again in PSR-12, but it makes it

Re: [PSR-12] Operators MUST be preceded and followed by at least one space

2018-04-23 Thread Larry Garfield
On Sunday, April 22, 2018 11:30:06 PM CDT Greg Sherwood wrote: > Point taken, but I'm really more focused on the sort of code I posted > originally. Leaving a rule completely open is fine, but I want to make sure > that is the intention given it will absolutely lead to messy code (created > by

Re: [PSR-12] Blank line after trait use import statement

2018-04-23 Thread Larry Garfield
I would concur here. The spec should be adapted to clarify that all blank line rules are single-blank-line rules. --Larry Garfield On Sunday, April 22, 2018 9:24:10 PM CDT Joe T. wrote: > i'm not in the WG, but i always restrict to 1 blank line between any two > structures - aside from line

Re: [PSR-12] Spacing for INSTEADOF and AS in trait trait use blocks

2018-04-23 Thread 'Alexander Makarov' via PHP Framework Interoperability Group
At least one may make sense for aligning: > Hi, > > I'm working on the PSR-12 standard for PHP_CodeSniffer. I have a question > about this section at the bottom of 4.2: > > When using the insteadof and as operators they must be used as follows >> taking note of indentation, spacing and new

Re: [PSR-12] Operators MUST be preceded and followed by at least one space

2018-04-23 Thread 'Alexander Makarov' via PHP Framework Interoperability Group
Yes, it was intentionally left open for alignment purpose. On Monday, April 23, 2018 at 7:30:06 AM UTC+3, Greg Sherwood wrote: > > On Monday, 23 April 2018 14:16:40 UTC+10, Daniel Hunsaker wrote: >> >> I often find it helpful to align operators other than assignment >> operators, too.

Re: [PSR-12] Blank line after trait use import statement

2018-04-23 Thread Greg Sherwood
The use group I'm talking about is for importing traits and not the use block in the header of the file. In the example file given in that section, these use statements fall into the area denoted by the comment "// ... additional PHP code ..." so I can't see how that section applies to these

Re: [PSR-14][Entrance][VOTE]

2018-04-23 Thread Alessandro Lai
As all current members of the CC committee have voted, this vote can be considered closed. The vote has passed unanimously! I'll open the PR to change the PSR status immediately. Il giorno lunedì 23 aprile 2018 02:13:41 UTC+2, Samantha Quiñones ha scritto: > > +1 > > (sorry, Larry <3) > > On

Re: [PSR-12] Blank line after trait use import statement

2018-04-23 Thread Alessandro Lai
No, multiple blank lines are not allowed in the current spec. Section 3 refers to a SINGLE blank line: "The header of a PHP file may consist of a number of different blocks. If present, each of the blocks below MUST be separated by a single blank line, and MUST NOT contain a blank line."