Skip to content

Commit 76968b1

Browse files
committed
minor #6618 Added a note about coding standards and method arguments (javiereguiluz)
This PR was submitted for the 2.3 branch but it was merged into the 2.7 branch instead (closes #6618). Discussion ---------- Added a note about coding standards and method arguments This coding standard is optional in the PSR-2 standard, so we must explain our own convention. Related to symfony/symfony#18890. Commits ------- b7429a5 Added a note about coding standards and method arguments
2 parents fa92eac + b7429a5 commit 76968b1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contributing/code/standards.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,19 @@ Structure
153153
that are not intended to be instantiated from the outside and thus are not
154154
concerned by the `PSR-0`_ and `PSR-4`_ autoload standards;
155155

156+
* Declare the class inheritance and all the implemented interfaces on the same
157+
line as the class name;
158+
156159
* Declare class properties before methods;
157160

158161
* Declare public methods first, then protected ones and finally private ones.
159162
The exceptions to this rule are the class constructor and the ``setUp`` and
160163
``tearDown`` methods of PHPUnit tests, which should always be the first methods
161164
to increase readability;
162165

166+
* Declare all the arguments on the same line as the method/function name, no
167+
matter how many arguments there are;
168+
163169
* Use parentheses when instantiating classes regardless of the number of
164170
arguments the constructor has;
165171

0 commit comments

Comments
 (0)