@@ -1283,13 +1283,15 @@ function allowed()
1283
1283
1284
1284
### 11.1 Basics
1285
1285
1286
- Attribute names must immediately follow the opening attribute block indicator `#[` with no space.
1286
+ Attribute names MUST immediately follow the opening attribute block indicator `#[` with no space.
1287
1287
1288
1288
If an attribute has no arguments, the `()` MUST be omitted.
1289
1289
1290
1290
The closing attribute block indicator `]` MUST follow the last character of the attribute name or the closing `)` of
1291
1291
its argument list, with no preceding space.
1292
1292
1293
+ The construct `#[...]` is referred to as an " attribute block" in this document.
1294
+
1293
1295
### 11.2 Placement
1294
1296
1295
1297
Attributes on classes, methods, functions, constants and properties MUST
@@ -1306,15 +1308,15 @@ If a comment docblock is present on a structure that also includes an attribute,
1306
1308
come first, followed by any attributes, followed by the structure itself. There MUST NOT be any blank lines
1307
1309
between the docblock and attributes, or the attributes and the structure.
1308
1310
1309
- If two separate attribute blocks (denoted by separate `#[]` markers) are used in a multi-line context,
1310
- they MUST be on separate lines with no blank lines between them.
1311
+ If two separate attribute blocks are used in a multi-line context, they MUST be on separate lines with no blank
1312
+ lines between them.
1311
1313
1312
1314
### 11.3 Compound attributes
1313
1315
1314
- Multiple attributes MAY be placed in the same attribute block (`#[]`) if and only if the entire block is listed on a
1315
- single line and each attribute is reasonably short . They MUST be separated by a comma with a space following but no space preceding. If the attribute list
1316
- is split into multiple lines for any reason, then the attributes MUST be placed in separate attribute blocks.
1317
- Those blocks may themselves contain multiple attributes provided this rule is respected.
1316
+ If multiple attributes are placed in the same attribute block, they MUST be separated by a comma with a space
1317
+ following but no space preceding . If the attribute list is split into multiple lines for any reason, then the
1318
+ attributes MUST be placed in separate attribute blocks. Those blocks may themselves contain multiple
1319
+ attributes provided this rule is respected.
1318
1320
1319
1321
If an attribute ' s argument list is split into multiple lines for any reason, then:
1320
1322
@@ -1354,7 +1356,8 @@ class Demo
1354
1356
prop: ' val ' ,
1355
1357
other: 5,
1356
1358
)]
1357
- #[Other, Stuff, Here]
1359
+ #[Other, Stuff]
1360
+ #[Here]
1358
1361
public function complicated(
1359
1362
string $a,
1360
1363
0 commit comments