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 quite hard to figure out how to enforce
the rules because you have to interpret so much from a piece of sample code
and you never know if the authors meant for you to read so much into it.
>From just the one PSR-12 sample I posted originally:
class Talker
> {
> use A, B, C {
> B::smallTalk insteadof A;
> A::bigTalk insteadof C;
> C::mediumTalk as FooBar;
> }
> }
I see the following rules:
- exactly one space after use
- no spaces before commas
- exactly one space after commas
- all class names on the same line
- opening brace on same line as class names
- exactly one space before opening brace
- insteadof/as statements indented 4 spaces
- no blank lines between statements
- exactly 1 space before insteadof/as
- exactly 1 space after insteadof/as
- no spaces around double colons
- no space before semicolons
- closing brace on line by itself
- closing brace aligned with use keyword
It would be really really helpful if those rules were listed along with
each sample. So rather than "indentation, spacing and new lines", the
standard told you exactly what to take note of.
Greg
On Tuesday, 24 April 2018 06:04:54 UTC+10, Alexander Makarov wrote:
>
> At least one may make sense for aligning:
>
> <?php
> class Talker
> {
> use A, B, C {
> B::smallTalk insteadof A;
> A::bigTalk insteadof C;
> C::mediumTalk as FooBar;
> }
> }
>
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/e41c9bab-d383-442d-bba6-7d36333696eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.