8000 Merge branch '6.0' into 6.1 · symfony/symfony-docs@c2b642b · GitHub
[go: up one dir, main page]

Skip to content

Commit c2b642b

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Minor tweak [Standards] Add constructor property promotion
2 parents 7ba0c87 + 5006315 commit c2b642b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contributing/code/standards.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ Structure
180180
to increase readability;
181181

182182
* Declare all the arguments on the same line as the method/function name, no
183-
matter how many arguments there 796C are;
183+
matter how many arguments there are. The only exception are constructor methods
184+
using `constructor property promotion`_, where each parameter must be on a new
185+
line with `trailing comma`_;
184186

185187
* Use parentheses when instantiating classes regardless of the number of
186188
arguments the constructor has;
@@ -299,3 +301,5 @@ License
299301
.. _`camelCase`: https://en.wikipedia.org/wiki/Camel_case
300302
.. _`UpperCamelCase`: https://en.wikipedia.org/wiki/Camel_case
301303
.. _`snake_case`: https://en.wikipedia.org/wiki/Snake_case
304+
.. _`constructor property promotion`: https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion
305+
.. _`trailing comma`: https://wiki.php.net/rfc/trailing_comma_in_parameter_list

0 commit comments

Comments
 (0)
0