Skip to content

Commit a774903

Browse files
committed
Revise compound section.
1 parent b969752 commit a774903

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

spec.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,13 +1283,15 @@ function allowed()
12831283

12841284
### 11.1 Basics
12851285

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.
12871287

12881288
If an attribute has no arguments, the `()` MUST be omitted.
12891289

12901290
The closing attribute block indicator `]` MUST follow the last character of the attribute name or the closing `)` of
12911291
its argument list, with no preceding space.
12921292

1293+
The construct `#[...]` is referred to as an "attribute block" in this document.
1294+
12931295
### 11.2 Placement
12941296

12951297
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,
13061308
come first, followed by any attributes, followed by the structure itself. There MUST NOT be any blank lines
13071309
between the docblock and attributes, or the attributes and the structure.
13081310

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.
13111313

13121314
### 11.3 Compound attributes
13131315

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.
13181320

13191321
If an attribute's argument list is split into multiple lines for any reason, then:
13201322
@@ -1354,7 +1356,8 @@ class Demo
13541356
prop: 'val',
13551357
other: 5,
13561358
)]
1357-
#[Other, Stuff, Here]
1359+
#[Other, Stuff]
1360+
#[Here]
13581361
public function complicated(
13591362
string $a,
13601363

0 commit comments

Comments
 (0)