Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d09b00c

Browse filesBrowse files
committed
Merge pull request #2994 from WouterJ/namespace_standards
Added some doc standards
2 parents ae5a6d2 + 8d95119 commit d09b00c
Copy full SHA for d09b00c

File tree

Expand file treeCollapse file tree

1 file changed

+14
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-4
lines changed

‎contributing/documentation/standards.rst

Copy file name to clipboardExpand all lines: contributing/documentation/standards.rst
+14-4Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Sphinx
1616
shorthand);
1717
* Inline hyperlinks are **not** used. Seperate the link and their target
1818
definition, which you add on the bottom of the page;
19+
* Inline markup should be closed at the same line as the open-string;
1920
* You should use a form of *you* instead of *we*.
2021

2122
Example
@@ -26,8 +27,8 @@ Example
2627
Example
2728
=======
2829
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.
3132
3233
Level 2
3334
-------
@@ -43,7 +44,7 @@ Example
4344
4445
echo 'You cannot use the :: shortcut here';
4546
46-
.. _`Symfony Docs`: http://symfony.com/doc/current/contributing/documentation/standards.html
47+
.. _`Symfony Documentation`: http://symfony.com/doc/current/contributing/documentation/standards.html
4748
4849
Code Examples
4950
-------------
@@ -60,6 +61,10 @@ Code Examples
6061
* Description of the folded code: (optional)
6162
If you fold several lines: the description of the fold can be placed after the ``...``
6263
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;
6368
* If useful, a ``codeblock`` should begin with a comment containing the filename
6469
of the file in the code block. Don't place a blank line after this comment,
6570
unless the next line is also a comment;
@@ -82,8 +87,11 @@ Example
8287
.. code-block:: php
8388
8489
// src/Foo/Bar.php
90+
namespace Foo;
8591
92+
use Acme\Demo\Cat;
8693
// ...
94+
8795
class Bar
8896
{
8997
// ...
@@ -93,9 +101,11 @@ Example
93101
// set foo with a value of bar
94102
$foo = ...;
95103
104+
$cat = new Cat($foo);
105+
96106
// ... check if $bar has the correct value
97107
98-
return $foo->baz($bar, ...);
108+
return $cat->baz($bar, ...);
99109
}
100110
}
101111

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.