16
16
shorthand);
17
17
* Inline hyperlinks are **not ** used. Seperate the link and their target
18
18
definition, which you add on the bottom of the page;
19
+ * Inline markup should be closed at the same line as the open-string;
19
20
* You should use a form of *you * instead of *we *.
20
21
21
22
Example
@@ -26,8 +27,8 @@ Example
26
27
Example
27
28
=======
28
29
29
- When you are working on the docs, you should follow the `Symfony Docs`_
30
- standards.
30
+ When you are working on the docs, you should follow the
31
+ `Symfony Documentation`_ standards.
31
32
32
33
Level 2
33
34
-------
@@ -43,7 +44,7 @@ Example
43
44
44
45
echo 'You cannot use the :: shortcut here';
45
46
46
- .. _`Symfony Docs `: http://symfony.com/doc/current/contributing/documentation/standards.html
47
+ .. _`Symfony Documentation `: http://symfony.com/doc/current/contributing/documentation/standards.html
47
48
48
49
Code Examples
49
50
-------------
@@ -60,6 +61,10 @@ Code Examples
60
61
* Description of the folded code: (optional)
61
62
If you fold several lines: the description of the fold can be placed after the ``... ``
62
63
If you fold only part of a line: the description can be placed before the line;
64
+ * If usefull, a PHP file should start with the namespace declaration;
65
+ * When using use statements, only the first code block of an article shows the
66
+ full statement block. In further examples, this block is folded with a
67
+ ``// ... `` comment and only new use statements are displayed;
63
68
* If useful, a ``codeblock `` should begin with a comment containing the filename
64
69
of the file in the code block. Don't place a blank line after this comment,
65
70
unless the next line is also a comment;
@@ -82,8 +87,11 @@ Example
82
87
.. code-block :: php
83
88
84
89
// src/Foo/Bar.php
90
+ namespace Foo;
85
91
92
+ use Acme\Demo\Cat;
86
93
// ...
94
+
87
95
class Bar
88
96
{
89
97
// ...
@@ -93,9 +101,11 @@ Example
93
101
// set foo with a value of bar
94
102
$foo = ...;
95
103
104
+ $cat = new Cat($foo);
105
+
96
106
// ... check if $bar has the correct value
97
107
98
- return $foo ->baz($bar, ...);
108
+ return $cat ->baz($bar, ...);
99
109
}
100
110
}
101
111
0 commit comments