Skip to content

Commit 6f6b5b5

Browse files
committed
minor #16725 [Standards] Add constructor property promotion (Jarek-Ikaniewicz)
This PR was submitted for the 6.0 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Standards] Add constructor property promotion Issue #16607 Commits ------- cf3b74c [Standards] Add constructor property promotion
2 parents 1158bde + cf3b74c commit 6f6b5b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

contributing/code/standards.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ 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 are;
183+
matter how many arguments there are (with exception of `constructor property promotion`_);
184+
185+
* When using `constructor property promotion`_ put each parameter on a new line with
186+
`trailing comma`_;
184187

185188
* Use parentheses when instantiating classes regardless of the number of
186189
arguments the constructor has;
@@ -299,3 +302,5 @@ License
299302
.. _`camelCase`: https://en.wikipedia.org/wiki/Camel_case
300303
.. _`UpperCamelCase`: https://en.wikipedia.org/wiki/Camel_case
301304
.. _`snake_case`: https://en.wikipedia.org/wiki/Snake_case
305+
.. _`constructor property promotion`: https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion
306+
.. _`trailing comma`: https://wiki.php.net/rfc/trailing_comma_in_parameter_list

0 commit comments

Comments
 (0)