-
Notifications
You must be signed in to change notification settings - Fork 26
3.0 changelog #116
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
base: master
Are you sure you want to change the base?
3.0 changelog #116
Conversation
@@ -0,0 +1,156 @@ | |||
# Migrating from PER-CS v1.0 (PSR-12) to PER-CS v2.0 ### |
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.
# Migrating from PER-CS v1.0 (PSR-12) to PER-CS v2.0 ### | |
# Migrating from PER-CS v2.0 to PER-CS v3.0 ### |
Formatting conventions are now provided for compound types (those that include union or intersection type declarations). | ||
|
||
* The `|` and `&` symbols and parentheses MUST NOT have leading or trailing spaces. | ||
* If a type declaration is long enough to split to multiple lines, each ANDed block must be on one line, and each ORed block on its own line. |
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.
* If a type declaration is long enough to split to multiple lines, each ANDed block must be on one line, and each ORed block on its own line. | |
* If a type declaration is long enough to split to multiple lines, each block must be on one line, and each block on its own line. |
|
||
## [Section 2.7 - Naming](https://www.php-fig.org/per/coding-style/#27-naming) | ||
|
||
PER-CS now recommends following the same naming conventions as PHP Internals for abbreviations and acronyms. Specifically, only uppercase the first character of the acronym: `XmlFormatter`, not `XMLFormatter`. |
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.
PER-CS now recommends following the same naming conventions as PHP Internals for abbreviations and acronyms. Specifically, only uppercase the first character of the acronym: `XmlFormatter`, not `XMLFormatter`. | |
PER-CS now recommends following the same naming conventions as PHP Internals for abbreviations and acronyms. Specifically, only uppercase the first character of the acronym: `XmlFormatter`, not `XMLFormatter`. |
|
||
## [Section 4.6 - Modifier Keywords](https://www.php-fig.org/per/coding-style/#46-modifier-keywords) | ||
|
||
At least one of `readonly`, `get`-visibility, and `set`-visibility must be specified. If at least one is specified, the others may be omitted. |
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.
At least one of `readonly`, `get`-visibility, and `set`-visibility must be specified. If at least one is specified, the others may be omitted. | |
At least one of `readonly`, `get`-visibility, and `set`-visibility must be specified. If at least one is specified, the others may be omitted. |
|
||
Formatting guidelines for property hooks are now included. | ||
|
||
When using property hooks on a constructor promoted property, only single-line set hooks are allowed. Anything more complicated MUST be defined separately from the constructor. |
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.
When using property hooks on a constructor promoted property, only single-line set hooks are allowed. Anything more complicated MUST be defined separately from the constructor. | |
When using property hooks on a constructor promoted property, only single-line set hooks are allowed. Anything more complicated MUST be defined separately from the constructor. |
|
||
## [Section 6.4 - Operator placement](https://www.php-fig.org/per/coding-style/#64-operator-placement) | ||
|
||
When breaking a series of chained operations across multiple lines, the operator MUST be at the beginning of each line, not the end of each line, and all lines but the first MUST be indented. Examples include `??` and ternary conditionals. |
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.
When breaking a series of chained operations across multiple lines, the operator MUST be at the beginning of each line, not the end of each line, and all lines but the first MUST be indented. Examples include `??` and ternary conditionals. | |
When breaking a series of chained operations across multiple lines, the operator MUST be at the beginning of each line, not the end of each line, and all lines but the first MUST be indented. Examples include `??` and ternary conditionals. |
The links point to the live site, like the 2.0 changelog does, so not all of them will work yet. They should once it's tagged and published, though.