You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposed/phpdoc.md
+14-17Lines changed: 14 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ PSR-5: PHPDoc
19
19
20
20
## 1. Introduction
21
21
22
-
The purpose of the PSR is to provide a formal definition of the PHPDoc standard.
22
+
This PSR defines a formal specification for the PHPDoc standard.
23
23
24
24
## 2. Conventions Used In This Document
25
25
@@ -49,7 +49,7 @@ interpreted as described in [RFC 2119][RFC2119].
49
49
50
50
It is RECOMMENDED to precede a "Structural Element" with a DocBlock where it
51
51
is defined. It is common practice to have the DocBlock precede a Structural
52
-
Element but it MAY also be separated by any number of empty lines.
52
+
Element, but it MAY also be separated by any number of empty lines.
53
53
54
54
Examples:
55
55
@@ -116,7 +116,7 @@ interpreted as described in [RFC 2119][RFC2119].
116
116
}
117
117
```
118
118
119
-
* "DocComment" is a special type of comment which MUST
119
+
* "DocComment" is a special type of comment that MUST
120
120
121
121
- start with the character sequence `/**` followed by a whitespace character
122
122
- end with `*/` and
@@ -156,7 +156,7 @@ interpreted as described in [RFC 2119][RFC2119].
156
156
The PHPDoc format has the following [ABNF][RFC5234] definition:
157
157
158
158
PHPDoc = [summary [description]] [tags]
159
-
eol = [CR] LF ; to compatible with PSR-12
159
+
eol = [CR] LF ; to be compatible with PSR-12
160
160
summary = 1*CHAR 2*eol
161
161
description = 1*(CHAR / inline-tag) 1*eol ; any amount of characters
162
162
; with inline tags inside
@@ -173,7 +173,7 @@ Examples of use are included in chapter 5.4.
173
173
174
174
### 5.1. Summary
175
175
176
-
A Summary MUST contain an abstract of the "Structural Element" defining the
176
+
A Summary MUST provide an abstract of the "Structural Element" defining the
177
177
purpose. It is RECOMMENDED for Summaries to span a single line or two, but not
178
178
more than that.
179
179
@@ -183,17 +183,16 @@ content in the PHPDoc.
183
183
If a Description is provided, then it MUST be preceded by a Summary. Otherwise
184
184
the Description risks being mistaken as the Summary.
185
185
186
-
Because a Summary is comparable to a chapter title, it is RECOMMENDED to use as
187
-
little formatting as possible. Contrary to the Description, no recommendation is
188
-
made to support a mark-up language.
186
+
Because a Summary is comparable to a chapter title, it is NOT RECOMMENDED to use formatting.
187
+
Contrary to the Description, no recommendation is made to support Markdown.
189
188
190
189
### 5.2. Description
191
190
192
191
The Description is OPTIONAL but SHOULD be included when the "Structural Element"
193
192
contains more complexity than can be described by the Summary alone.
194
193
195
194
Any application parsing the Description is RECOMMENDED to support the
196
-
Markdown mark-up language, to make it possible for the author to provide
195
+
Markdown language, to make it possible for the author to provide
197
196
formatting and a clear way of representing code examples.
198
197
199
198
Common uses for the Description:
@@ -215,11 +214,10 @@ tags with the same syntax. An inline tag MUST start with `{@` and MUST with `}`
215
214
*/
216
215
```
217
216
218
-
Inline tags are only covering regular tags and SHALL NOT cover_Annotation_ tags.
217
+
Inline tags MAY only represent regular tags and SHALL NOT represent_Annotation_ tags.
219
218
220
219
As inline tags are always closed with a `}` developers cannot use this char in a
221
-
description. To overcome this issue parsers MUST support escape char `{` followed
222
-
by `}` to be interpreted as a single `}`
220
+
description. To overcome this issue parsers MUST support escape sequence of `{` followed by `}` MUST be interpreted as a literal closing brace.
223
221
224
222
```php
225
223
/**
@@ -231,9 +229,8 @@ by `}` to be interpreted as a single `}`
231
229
232
230
### 5.3. Tags
233
231
234
-
Tags supply concise metadata for a "Structural Element". Each tag starts on a
235
-
new line, followed by an at-sign (`@`) and a tag-name, followed by whitespace and
236
-
metadata (including a description).
232
+
Tags supply concise metadata for a "Structural Element". Each tag MUST start on a
233
+
new line, followed by an at-sign (`@`) and a tag-name, then optional whitespace and metadata.
237
234
238
235
If metadata is provided, it MAY span multiple lines and COULD follow a strict
239
236
format, as dictated by the specific tag.
@@ -263,7 +260,7 @@ This definition does NOT apply to _Annotation_ tags, which are not in scope.
263
260
264
261
#### 5.3.1 Tag Specialization
265
262
266
-
Tag specialization give a scope to the tag. It is RECOMMENDED to follow the
263
+
Tag specialization defines a scope for the tag. It is RECOMMENDED to follow the
267
264
list of tags in the tag [Tag Catalog PSR][TAG_PSR]. But the metadata of specialized
268
265
tags MAY differ from the list.
269
266
@@ -284,7 +281,7 @@ Tag names indicate what type of information is represented by this tag.
284
281
Whitespace handling for parsing DocBlocks MUST follow these rules:
285
282
286
283
- Leading and trailing whitespace characters (spaces, tabs) on each line MUST be ignored.
287
-
- Lines in descriptions or tag metadata MAY contain multiple whitespace characters between words, but the number of spaces MUST NOT affect interpretation.
284
+
- Lines in descriptions or tag metadata MAY contain multiple whitespace characters between words, but varying amounts of whitespace MUST NOT alter the meaning.
288
285
For example: `@param string $var` is semantically equivalent to `@param string $var`
289
286
290
287
- A description MAY contain empty lines. These are preserved as part of the Markdown block and MUST NOT be interpreted as ending the description.
0 commit comments