Skip to content

Commit d59aae4

Browse files
committed
Add a constructor example for attributes, including blank lines.
1 parent c5d60e6 commit d59aae4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,9 @@ be placed on their own line, immediately prior to the structure being described.
12981298
For attributes on parameters, if the parameter list is presented on a single line,
12991299
the attribute MUST be placed inline with the parameter it describes, separated by a single space.
13001300
If the parameter list is split into multiple lines for any reason, the attribute MUST be placed on
1301-
its own line prior to the parameter, indented the same as the parameter.
1301+
its own line prior to the parameter, indented the same as the parameter. If the parameter list
1302+
is split into multiple lines, a blank line MAY be included between one parameter and the attributes
1303+
of the following parameter in order to aid readability.
13021304

13031305
If a comment docblock is present on a structure that also includes an attribute, the comment block MUST
13041306
come first, followed by any attributes, followed by the structure itself. There MUST NOT be any blank lines
@@ -1331,6 +1333,14 @@ class Demo
13311333
#[Beep]
13321334
private Foo $foo;
13331335
1336+
public function __construct(
1337+
#[Load(context: 'foo', bar: true)]
1338+
private readonly FooService $fooService,
1339+
1340+
#[LoadProxy(context: 'bar')]
1341+
private readonly BarService $barService,
1342+
) {}
1343+
13341344
/**
13351345
* Sets the foo.
13361346
*/

0 commit comments

Comments
 (0)