Skip to content

Commit 51f92d3

Browse files
authored
Add a section about versioning
1 parent f2cdd2c commit 51f92d3

File tree

1 file changed

+38
-19
lines changed

1 file changed

+38
-19
lines changed

meta.md

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To help alleviate this issue with PSR-12, we have taken a more prescriptive appr
2626
defined the standards for new language features as they are released.
2727

2828
However, it is for a lack of wanting to be dictatorial that we aimed to apply PSR-2
29-
styling, rationale and stances (Described in Section 4, Approaches) in PSR-12 instead of
29+
styling, rationale and stances (Described in Section 5, Approaches) in PSR-12 instead of
3030
establishing new conventions.
3131

3232
The same approach is applied to the current PER.
@@ -57,12 +57,31 @@ PSR-12.
5757
It is not the intention of this PER to add entirely new coding style guidelines. It will
5858
also not change anything stipulated in PSR-1 and PSR-12.
5959

60-
## 4. Approaches
60+
## 4. Versioning
61+
62+
New releases of this PER are assigned version numbers in keeping with [semantic versioning](https://semver.org/). Semantic versioning is well defined when applied to software releases but has no common definition in other contexts. This PER applies the following meanings:
63+
64+
* **Patch** versions may contain:
65+
* Any changes that do not alter the underlying requirements of the PER, such as fixing typos, adding clarifications or other modifications with no compatibility impact.
66+
* **Minor** versions may additionally:
67+
* Add new `MAY` or `OPTIONAL` requirements.
68+
* Add any new requirements for PHP syntax previously unspecified in this PER.
69+
* Remove `MUST NOT`, `SHALL NOT`, `SHOULD NOT` or `NOT RECOMMENDED` requirements.
70+
* **Major** versions may additionally:
71+
* Add any new requirements.
72+
* Remove any requirements.
73+
* Meaningfully alter any requirements.
74+
75+
Projects are expected to pin their own coding style guidelines to a major version of this PER, allowing for regular upgrades to minor and patch releases as they are published. When performing such upgrades, it is intended that no change to existing code is required to maintain compliance with all requirements and recommendations of the PER. This ensures new code contributions processed by an automatic formatter follow (or disregard) recommendations consistently with the existing code.
76+
77+
Please note this backwards compatibility promise does not extend to projects that use new PHP syntax yet to be specified in this PER. In this circumstance, a minor version may introduce new requirements that conflict with syntax usage in existing code.
78+
79+
## 5. Approaches
6180

6281
The overarching approach is to attempt to apply existing PSR-12 styling and rationale to
6382
new functionality as opposed to establishing new conventions.
6483

65-
### 4.1. Strict Types Declarations
84+
### 5.1. Strict Types Declarations
6685

6786
There was a discussion about whether strict types should be enforced in the standard
6887
https://github.com/cs-extended/fig-standards/issues/7. All were in agreement we should only
@@ -71,25 +90,25 @@ to say that strict types could not be declared. The discussion was whether it sh
7190
considered a coding style item which should be covered or whether it was out of scope, and it
7291
was decided to be out of scope of a coding style guide.
7392

74-
### 4.2. Finally and Return Types Declaration Spacing
93+
### 5.2. Finally and Return Types Declaration Spacing
7594

7695
Numerous options were suggested, and they can be seen
7796
[here for return type declarations](https://gist.github.com/michaelcullum/c025f3870c9ea1dd2668#file-returntypesspacing-php) or
7897
[here for finally blocks](https://gist.github.com/michaelcullum/c025f3870c9ea1dd2668#file-finallyblocks-php)
7998
and the current implementation was chosen due to consistency with other parts of the standard.
8099

81-
### 4.3. Enforcing short form for all type keywords
100+
### 5.3. Enforcing short form for all type keywords
82101

83102
PHP 7.0 introduced [scalar types declaration](http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration)
84103
which does not support long type aliases. Therefore, it makes sense to enforce primary short type forms to be used to
85104
have uniform syntax and prevent possible confusion.
86105

87-
### 4.4. Public Survey
106+
### 5.4. Public Survey
88107

89108
In order to settle things using data, survey was conducted and responses from 142 people
90109
including 17 project representatives were gathered:
91110

92-
#### 4.4.1. PHP-FIG Representative Results
111+
#### 5.4.1. PHP-FIG Representative Results
93112

94113
| Representative | Project | Compound namespaces with a depth of two or more MUST not be used | Header statement grouping and ordering | Declare statements must each be on their own line | Declare statements in PHP files containing markup | Declare statements have no spaces: `declare(strict_types=1);` | Block declare statement formatting | `new` keyword usage, parenthesis required |Return type declaration formatting |Use statement leading slashes disallowed | Block namespace declaration formatting | General operator spacing |Try, Catch, Finally formatting | Anonymous class declaration formatting | Keyword casing, only lower case | Type keywords, short form only |
95114
| -------------- | ------- | ---------------------------------------------------- | ---------------------------------- | ----------------------------------------- | ------------------------------------------- | -------------------------------------------------------- | ------------------------------- | ------------------------------------- |------------------------------- |------------------------------------ | ----------------------------------- | ---------------------- |--------------------------- | ----------------------------------- | --------------------------- | -------------------------- |
@@ -111,7 +130,7 @@ including 17 project representatives were gathered:
111130
| Chuck Burgess | PEAR ||||||||||||||||
112131
| | **Totals**: |13/3|15/1|15/1|13/3|14/2|15/1|14/2|15/1|14/2|14/2|15/1|16/0|15/1|15/1|15/1|
113132

114-
#### 4.4.2. General non-representative voters
133+
#### 5.4.2. General non-representative voters
115134

116135
| Question | For | Against | Percentage For |
117136
| -------- | --- | ------- | -------------- |
@@ -131,7 +150,7 @@ including 17 project representatives were gathered:
131150
| Keyword casing, only lower case | 124 | 2 | 98.39% |
132151
| Type keywords, short form only | 121 | 5 | 95.87% |
133152

134-
### 4.5. Multiline Function Arguments Mixed With Multiline Return
153+
### 5.5. Multiline Function Arguments Mixed With Multiline Return
135154

136155
A potential readability issue [was raised on the mailing list](https://groups.google.com/d/msg/php-fig/ULSL4gqK8GY/cgDELuPOCQAJ).
137156
We reviewed options for changes to the specification that could provide better readability and
@@ -140,13 +159,13 @@ arguments and the return are both multiline. Instead, it was pointed out that th
140159
_already_ allows you to decide where you'd like to add blank lines, and so we will leave it to
141160
the implementors to decide.
142161

143-
## 5. Changelog
162+
## 6. Changelog
144163

145164
Please note this changelog is not a verbose list of changes from PSR-12 and further but highlights the most
146165
notable changes. It should be considered a new specification, and therefore you should read the
147166
specification for a full understanding of its contents.
148167

149-
### 5.1. New Statements
168+
### 6.1. New Statements
150169

151170
* Lowercase for all keywords - Section 2.5
152171
* Short form for all type keywords - Section 2.5
@@ -165,7 +184,7 @@ specification for a full understanding of its contents.
165184
* Ternary operators - Section 6.3
166185
* Anonymous classes - Section 8
167186

168-
### 5.2. Clarifications and Errata
187+
### 6.2. Clarifications and Errata
169188

170189
* Adjust 'methods' to 'methods and functions' in a number of instances - Throughout
171190
* Adjust references to classes and interfaces to also include traits - Throughout
@@ -176,33 +195,33 @@ specification for a full understanding of its contents.
176195
* PSR-2 errata statement about extending multiple interfaces - Section 4
177196
* Forbid blank lines before/after closing/opening braces for classes - Section 4
178197

179-
## 6. People
198+
## 7. People
180199

181-
### 6.1. Editor:
200+
### 7.1. Editor:
182201

183202
* Korvin Szanto
184203

185-
### 6.2. Sponsor:
204+
### 7.2. Sponsor:
186205

187206
* Chris Tankersley
188207

189-
### 6.3. Working Group Members:
208+
### 7.3. Working Group Members:
190209

191210
* Alexander Makarov
192211
* Ken Guest
193212
* Larry Garfield
194213
* Luke Diggins
195214
* Woody Gilk
196215

197-
### 6.4. Special Thanks
216+
### 7.4. Special Thanks
198217

199218
* Everyone involved in PSR-1, PSR-2, PSR-12.
200219

201-
## 7. Votes
220+
## 8. Votes
202221

203222
* **Entrance Vote:** https://groups.google.com/g/php-fig/c/YqPDYGK0RhM/m/pJmThkNKBgAJ
204223

205-
## 8. Relevant Links
224+
## 9. Relevant Links
206225

207226
_**Note:** Order descending chronologically._
208227

0 commit comments

Comments
 (0)