You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/documentation/overview.rst
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -70,17 +70,18 @@ GitHub covers the topic of `pull requests`_ in detail.
70
70
71
71
Standards
72
72
---------
73
-
To keep the examples in the documentation consistent and to help the reader as much as we can to understand the code, you need to follow these standards:
74
73
75
-
* The code follows the Coding Standards, the `Symfony Coding Standards`_ as well as the `Twig Coding Standards`_.
76
-
* When we fold one or more lines of code, we place `...` in a comment at the point of the fold. These comments are: `// ...` (php), `# ...` (yaml/bash), `{# ... #}` (twig), `<!-- ... -->` (xml/html), `; ...` (ini), `...` (text)
77
-
* When we fold a part of a line, e.g. a variable value, we put `...` (without comment) at the place of the fold.
74
+
In order to help the reader as much as possible and to create code examples that looks and feels familiar, you should follow these rules:
75
+
76
+
* The code follows the Coding Standards, the `Symfony Coding Standards`_ as well as the `Twig Coding Standards`_;
77
+
* When we fold one or more lines of code, we place `...` in a comment at the point of the fold. These comments are: `// ...` (php), `# ...` (yaml/bash), `{# ... #}` (twig), `<!-- ... -->` (xml/html), `; ...` (ini), `...` (text);
78
+
* When we fold a part of a line, e.g. a variable value, we put `...` (without comment) at the place of the fold;
78
79
* Description about the fold: (optional)
79
80
If we fold some lines: The description can be placed after the `...`
80
-
If we fold a part of a line: The description can be placed before the line
81
-
* If usefull, a codeblock begins with a comment with the filename. After this file comment should not be a blank line, except if the next line is a comment too
82
-
* You should put a `$` in front of every bash line
83
-
* We prefer the `::` shorthand over `.. code-block:: php`
81
+
If we fold a part of a line: The description can be placed before the line;
82
+
* If usefull, a codeblock begins with a comment with the filename. After this comment should not be a blank line, except if the next line is a comment too;
83
+
* You should put a `$` in front of every bash line;
84
+
* We prefer the `::` shorthand over `.. code-block:: php` to begin a PHP code block.
84
85
85
86
An example::
86
87
@@ -92,12 +93,12 @@ An example::
92
93
93
94
// ... check if $bar has the correct value
94
95
95
-
return $foo->baz($bar);
96
+
return $foo->baz($bar, ...);
96
97
}
97
98
98
99
.. note::
99
-
* You should to put a space after `{` and before `}` in Yaml (e.g. `{ _controller: ... }`), but this should not be done in Twig (e.g. `{'hello' : 'value'}`).
100
-
* An array item is a part of a line, not a total line. So don't use `// ...` but `...,` (the comma because of the Coding Standards):
100
+
* In Yaml you should to put a space after `{` and before `}` (e.g. `{ _controller: ... }`), but this should not be done in Twig (e.g. `{'hello' : 'value'}`).
101
+
* An array item is a part of a line, not a complete line. So you should not use `// ...` but `...,` (the comma because of the Coding Standards):
0 commit comments