-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose errata for anonymous classes #1206
Conversation
@@ -232,7 +232,7 @@ declare(ticks=1) { | |||
|
|||
## 4. Classes, Properties, and Methods | |||
|
|||
The term "class" refers to all classes, interfaces, and traits. | |||
The term "class" refers to all classes, anonymous classes, interfaces, and traits. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrahamCampbell comment makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding the parenthesis to samples makes sense, but only if we also describe why in errata. Adding anonymous classes to section 4 doesn't seem like a helpful change given the confusion.
I've added an errata paragraph, but I'm not to happy with that; any suggestion on how to rephrase that? |
I've committed a mix of @samdark & @PowerKiKi suggestions. |
@Jean85 Ready to be merged? |
This needs to go through a Core Committee vote to be approved. |
@Jean85 Is that already scheduled and when the outcome can be excepted? |
It's up to @KorvinSzanto as the editor of the PSR to approve and call the vote on this. |
Hello everyone, While it all looks nice and tidy without any constructor arguments, once they get introduced into the example, it goes haywire.
Let's see how this plays with constructor arguments present:
or as many of us work with object properties and getters, it aggravates the problem further:
While PSR-2 imposes only a soft limit of 120 characters on line length, and there is stricly speaking no problem from the PSR point of view, I think that enforcing In my opinion a clarification is needed that
Could this last code snippet be included as an example in addition to/instead of the current one? |
What's the status of this ? |
There's noone pushing those kind of changes. The main problem here is that we do not have a way to handle these changes in an iterating way: the language is evolving really fast (enum, union types, matches are just some of the new stuff) and the PSR process is "granitic", since a PSR is supposed to be immutable. We would need a "living document" kind of process, not the simple PSR way as of now, but we're out of ideas for now. If someone has some idea on how to proceed, it's welcome to discuss that with us, so we can try to define a formal process and make these kind of adjustments easy. |
@Jean85 standard immutable, but extendable (for example, RFC standards).
|
There is no "extendable with sub-spec" process for PSRs. That's not a thing. However, we do now have a PER process for evolving standards, and there is a working group for a Coding Standards PER to supplant PSR-12. So that's happening, just not here. Closing this issue accordingly. |
where I can read more about it? |
@Crell voting to modernize deprecated code looks like strange |
Checks the amount of spacing between the `class` keyword and the open parenthesis (if any) for anonymous class declarations. The expected amount of spacing is configurable and defaults to `0`. The default value of `0` has been decided upon based on scanning a not insignificant number of codebases and determining the prevailing style used for anonymous classes. It is also in line with the previously proposed [errata for PSR12](php-fig/fig-standards#1206). Includes fixer. Includes unit tests. Includes documentation. Includes metrics.
Checks the amount of spacing between the `class` keyword and the open parenthesis (if any) for anonymous class declarations. The expected amount of spacing is configurable and defaults to `0`. The default value of `0` has been decided upon based on scanning a not insignificant number of codebases and determining the prevailing style used for anonymous classes. It is also in line with the previously proposed [errata for PSR12](php-fig/fig-standards#1206). Includes fixer. Includes unit tests. Includes documentation. Includes metrics.
Checks the amount of spacing between the `class` keyword and the open parenthesis (if any) for anonymous class declarations. The expected amount of spacing is configurable and defaults to `0`. The default value of `0` has been decided upon based on scanning a not insignificant number of codebases and determining the prevailing style used for anonymous classes. It is also in line with the previously proposed [errata for PSR12](php-fig/fig-standards#1206). Includes fixer. Includes unit tests. Includes documentation. Includes metrics.
Reference ML discussion: https://groups.google.com/d/topic/php-fig/F0IVXx1LL_Q/discussion