Skip to content

Commit 6bc7adb

Browse files
committed
Merge branch '2.1' into 2.2
Conflicts: contributing/documentation/standards.rst
2 parents 210deef + ed0f3fd commit 6bc7adb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

contributing/documentation/standards.rst

+15-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Sphinx
1616
shorthand);
1717
* Inline hyperlinks are **not** used. Separate the link and their target
1818
definition, which you add on the bottom of the page;
19+
* Inline markup should be closed on the same line as the open-string;
1920

2021
Example
2122
~~~~~~~
@@ -25,8 +26,8 @@ Example
2526
Example
2627
=======
2728
28-
When you are working on the docs, you should follow the `Symfony Docs`_
29-
standards.
29+
When you are working on the docs, you should follow the
30+
`Symfony Documentation`_ standards.
3031
3132
Level 2
3233
-------
@@ -42,7 +43,7 @@ Example
4243
4344
echo 'You cannot use the :: shortcut here';
4445
45-
.. _`Symfony Docs`: http://symfony.com/doc/current/contributing/documentation/standards.html
46+
.. _`Symfony Documentation`: http://symfony.com/doc/current/contributing/documentation/standards.html
4647
4748
Code Examples
4849
-------------
@@ -59,6 +60,11 @@ Code Examples
5960
* Description of the folded code: (optional)
6061
If you fold several lines: the description of the fold can be placed after the ``...``
6162
If you fold only part of a line: the description can be placed before the line;
63+
* If useful to the reader, a PHP code example should start with the namespace
64+
declaration;
65+
* When referencing classes, be sure to show the ``use`` statements at the
66+
top of your code block. You don't need to show *all* ``use`` statements
67+
in every example, just show what is actually being used in the code block;
6268
* If useful, a ``codeblock`` should begin with a comment containing the filename
6369
of the file in the code block. Don't place a blank line after this comment,
6470
unless the next line is also a comment;
@@ -81,8 +87,11 @@ Example
8187
.. code-block:: php
8288
8389
// src/Foo/Bar.php
90+
namespace Foo;
8491
92+
use Acme\Demo\Cat;
8593
// ...
94+
8695
class Bar
8796
{
8897
// ...
@@ -92,9 +101,11 @@ Example
92101
// set foo with a value of bar
93102
$foo = ...;
94103
104+
$cat = new Cat($foo);
105+
95106
// ... check if $bar has the correct value
96107
97-
return $foo->baz($bar, ...);
108+
return $cat->baz($bar, ...);
98109
}
99110
}
100111

0 commit comments

Comments
 (0)