Questions on some coding styles

258 views
Skip to first unread message

kapitanluffy pirata

unread,
Aug 18, 2016, 10:08:13 PM8/18/16
to PHP Framework Interoperability Group
I was looking at PSR-2 and there are no suggestions to the following:

- Should empty lines have tabs that align with lines that have characters or should it be fully empty?

- When assigning variables, I see some aligning the equals sign (=) using spaces while others just use a space before and after the equals sign.

- should the dot have before and after spaces when concatenating strings?


I know PSR are just 'recommendations' and everyone can set their own standards along with PSR-2 but it would be great if we have "something to look up to" for a lack of better term

Alexander Makarov

unread,
Aug 21, 2016, 4:27:03 PM8/21/16
to PHP Framework Interoperability Group
Indeed these aren't addressed in PSR-2. There's PSR-12 in the works. First two cases aren't addressed as well so I've created issue for these:


Third case is addressed partially.

Paul Jones

unread,
Aug 21, 2016, 5:00:19 PM8/21/16
to php...@googlegroups.com

> On Aug 18, 2016, at 21:08, kapitanluffy pirata <kapita...@gmail.com> wrote:
>
> I was looking at PSR-2 and there are no suggestions to the following:
>
> - Should empty lines have tabs that align with lines that have characters or should it be fully empty?
>
> - When assigning variables, I see some aligning the equals sign (=) using spaces while others just use a space before and after the equals sign.
>
> - should the dot have before and after spaces when concatenating strings?

FWIW, these things were addressed in earlier versions of PSRs 1 and 2, but they were removed; IIRC, it was due to somewhat higher contention over those points, than over the points that made it into the final versions.


--

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



kapitanluffy pirata

unread,
Aug 21, 2016, 10:58:27 PM8/21/16
to PHP Framework Interoperability Group
Oh thanks, I subscribed to them.

Michael Cullum

unread,
Aug 22, 2016, 2:32:31 PM8/22/16
to PHP Framework Interoperability Group
If this was discussed for PSR-1/2 then intentionally omitted, especially if for reasons of contention, then it's out of scope for PSR-12 which should only *clarify statements that were incorrect or or unintentionally unambiguous* in PSR-1/2, and things that *relate to new functionality* added to PHP after such a time as it would not have been considered for PSR-1/2.

We shouldn't be breaking BC for something that is out of scope, the scope that PSR-12 was voted in [Entrance vote] under.

Thanks,
Michael

Note: I post this not as a Secretary but as a Former Editor of PSR-12 and in line with my declared conflicts of interest

Alexander Makarov

unread,
Aug 23, 2016, 8:00:23 AM8/23/16
to PHP Framework Interoperability Group
Then https://groups.google.com/forum/#!topic/php-fig/kIqR-7WI690 should be OK, right? It's was the new rule which was not present in PSR-2 and isn't connected with new PHP functionality.
Reply all
Reply to author
Forward
0 new messages