8000 Merge branch '4.0' · symfony/symfony-docs@718fb24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 718fb24

Browse files
committed
Merge branch '4.0'
* 4.0: Create an index page for the new Code of Conduct section Revert fix factory-service new syntax Fix values class references Fix spelling of Composer Removed all remaining Action() method suffixes
2 parents ae79008 + dcd9ded commit 718fb24

25 files changed

+148
-131
lines changed

components/using_components.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ whatever component you want.
3131

3232
.. tip::
3333

34-
`Install composer`_ if you don't have it already present on your system.
34+
`Install Composer`_ if you don't have it already present on your system.
3535
Depending on how you install, you may end up with a ``composer.phar``
3636
file in your directory. In that case, no worries! Just run
3737
``php composer.phar require symfony/finder``.
@@ -65,4 +65,4 @@ documentation to find out more about how to use it.
6565
And have fun!
6666

6767
.. _Composer: https://getcomposer.org
68-
.. _Install composer: https://getcomposer.org/download/
68+
.. _Install Composer: https://getcomposer.org/download/

configuration/micro_kernel_trait.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ Next, create an ``index.php`` file that defines the kernel class and executes it
5555
{
5656
// kernel is a service that points to this class
5757
// optional 3rd argument is the route name
58-
$routes->add('/random/{limit}', 'kernel:randomAction');
58+
$routes->add('/random/{limit}', 'kernel:randomNumber');
5959
}
6060

61-
public function randomAction($limit)
61+
public function randomNumber($limit)
6262
{
6363
return new JsonResponse(array(
6464
'number' => rand(0, $limit)
@@ -257,7 +257,7 @@ has one file in it::
257257
/**
258258
* @Route("/random/{limit}")
259259
*/
260-
public function randomAction($limit)
260+
public function randomNumber($limit)
261261
{
262262
$number = rand(0, $limit);
263263

console/command_in_controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Run this command from inside your controller via::
3636

3737
class SpoolController extends Controller
3838
{
39-
public function sendSpoolAction($messages = 10, KernelInterface $kernel)
39+
public function sendSpool($messages = 10, KernelInterface $kernel)
4040
{
4141
$application = new Application($kernel);
4242
$application->setAutoExit(false);
@@ -87,7 +87,7 @@ Now, use it in your controller::
8787

8888
class SpoolController extends Controller
8989
{
90-
public function sendSpoolAction($messages = 10)
90+
public function sendSpool($messages = 10)
9191
{
9292
// ...
9393
$output = new BufferedOutput(
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
Code of Conduct
2+
===============
3+
4+
Our Pledge
5+
----------
6+
7+
In the interest of fostering an open and welcoming environment, we as
8+
contributors and maintainers pledge to making participation in our project and
9+
our community a harassment-free experience for everyone, regardless of age, body
10+
size, disability, ethnic origin, gender identity and expression, level of experience,
11+
education, socio-economic status, nationality, personal appearance,
12+
religion, or sexual identity and orientation.
13+
14+
Our Standards
15+
-------------
16+
17+
Examples of behavior that contributes to creating a positive environment
18+
include:
19+
20+
* Using welcoming and inclusive language
21+
* Being respectful of differing viewpoints and experiences
22+
* Gracefully accepting constructive criticism
23+
* Focusing on what is best for the community
24+
* Showing empathy towards other community members
25+
26+
Examples of unacceptable behavior by participants include:
27+
28+
* The use of sexualized language or imagery and unwelcome sexual attention or
29+
advances
30+
* Trolling, insulting/derogatory comments, and personal or political attacks
31+
* Public or private harassment
32+
* Publishing others' private information, such as a physical or electronic
33+
address, without explicit permission
34+
* Other conduct which could reasonably be considered inappropriate in a
35+
professional setting
36+
37+
Our Responsibilities
38+
--------------------
39+
40+
:doc:`Enforcement team members </contributing/code_of_conduct/enforcement_team>`
41+
are responsible for clarifying the standards of acceptable
42+
behavior and are expected to take appropriate and fair corrective action in
43+
response to any instances of unacceptable behavior.
44+
45+
Enforcement team members have the right and responsibility to remove, edit, or
46+
reject comments, commits, code, wiki edits, issues, and other contributions
47+
that are not aligned to this Code of Conduct, or to ban temporarily or
48+
permanently any contributor for other behaviors that they deem inappropriate,
49+
threatening, offensive, or harmful.
50+
51+
Scope
52+
-----
53+
54+
This Code of Conduct applies both within project spaces and in public spaces
55+
when an individual is representing the project or its community. Examples of
56+
representing a project or community include using an official project e-mail
57+
address, posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event. Representation of a project may be
59+
further defined and clarified by enforcement team members.
60+
61+
Enforcement
62+
-----------
63+
64+
Instances of abusive, harassing, or otherwise unacceptable behavior
65+
:doc:`may be reported </contributing/code_of_conduct/reporting_guidelines>`
66+
by contacting the :doc:`enforcement team members </contributing/code_of_conduct/enforcement_team>`.
67+
All complaints will be reviewed and investigated and will result in a response that
68+
is deemed necessary and appropriate to the circumstances. The enforcement team is
69+
obligated to maintain confidentiality with regard to the reporter of an incident.
70+
Further details of specific enforcement policies may be posted separately.
71+
72+
Enforcement team members who do not follow or enforce the Code of Conduct in good
73+
faith may face temporary or permanent repercussions as determined by the
74+
:doc:`core team </contributing/code/core_team>`.
75+
76+
Attribution
77+
-----------
78+
79+
This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
80+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
81+
82+
Related Documents
83+
-----------------
84+
85+
.. toctree::
86+
:maxdepth: 1
87+
88+
reporting_guidelines
89+
enforcement_team
90+
concrete_example_document
91+
92+
.. _Contributor Covenant: https://www.contributor-covenant.org
Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,10 @@
11
Code of Conduct
22
===============
33

4-
Our Pledge
5-
----------
6-
7-
In the interest of fostering an open and welcoming environment, we as
8-
contributors and maintainers pledge to making participation in our project and
9-
our community a harassment-free experience for everyone, regardless of age, body
10-
size, disability, ethnic origin, gender identity and expression, level of experience,
11-
education, socio-economic status, nationality, personal appearance,
12-
religion, or sexual identity and orientation.
13-
14-
Our Standards
15-
-------------
16-
17-
Examples of behavior that contributes to creating a positive environment
18-
include:
19-
20-
* Using welcoming and inclusive language
21-
* Being respectful of differing viewpoints and experiences
22-
* Gracefully accepting constructive criticism
23-
* Focusing on what is best for the community
24-
* Showing empathy towards other community members
25-
26-
Examples of unacceptable behavior by participants include:
27-
28-
* The use of sexualized language or imagery and unwelcome sexual attention or
29-
advances
30-
* Trolling, insulting/derogatory comments, and personal or political attacks
31-
* Public or private harassment
32-
* Publishing others' private information, such as a physical or electronic
33-
address, without explicit permission
34-
* Other conduct which could reasonably be considered inappropriate in a
35-
professional setting
36-
37-
Our Responsibilities
38-
--------------------
39-
40-
:doc:`Enforcement team members </contributing/code_of_conduct/enforcement_team>`
41-
are responsible for clarifying the standards of acceptable
42-
behavior and are expected to take appropriate and fair corrective action in
43-
response to any instances of unacceptable behavior.
44-
45-
Enforcement team members have the right and responsibility to remove, edit, or
46-
reject comments, commits, code, wiki edits, issues, and other contributions
47-
that are not aligned to this Code of Conduct, or to ban temporarily or
48-
permanently any contributor for other behaviors that they deem inappropriate,
49-
threatening, offensive, or harmful.
50-
51-
Scope
52-
-----
53-
54-
This Code of Conduct applies both within project spaces and in public spaces
55-
when an individual is representing the project or its community. Examples of
56-
representing a project or community include using an official project e-mail
57-
address, posting via an official social media account, or acting as an appointed
58-
representative at an online or offline event. Representation of a project may be
59-
further defined and clarified by enforcement team members.
60-
61-
Enforcement
62-
-----------
63-
64-
Instances of abusive, harassing, or otherwise unacceptable behavior
65-
:doc:`may be reported </contributing/code_of_conduct/reporting_guidelines>`
66-
by contacting the :doc:`enforcement team members </contributing/code_of_conduct/enforcement_team>`.
67-
All complaints will be reviewed and investigated and will result in a response that
68-
is deemed necessary and appropriate to the circumstances. The enforcement team is
69-
obligated to maintain confidentiality with regard to the reporter of an incident.
70-
Further details of specific enforcement policies may be posted separately.
71-
72-
Enforcement team members who do not follow or enforce the Code of Conduct in good
73-
faith may face temporary or permanent repercussions as determined by the
74-
:doc:`core team </contributing/code/core_team>`.
75-
76-
Attribution
77-
-----------
78-
79-
This Code of Conduct is adapted from the `Contributor Covenant`_, version 1.4,
80-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
81-
82-
Related Documents
83-
-----------------
84-
854
.. toctree::
86-
:maxdepth: 1
5+
:maxdepth: 2
876

7+
code_of_conduct
888
reporting_guidelines
899
enforcement_team
9010
concrete_example_document
91-
92-
.. _Contributor Covenant: https://www.contributor-covenant.org

contributing/map.rst.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
* **Code of Conduct**
2+
3+
* :doc:`/contributing/code_of_conduct/code_of_conduct`
4+
* :doc:`/contributing/code_of_conduct/reporting_guidelines`
5+
* :doc:`/contributing/code_of_conduct/enforcement_team`
6+
* :doc:`/contributing/code_of_conduct/concrete_example_document`
7+
18
* **Code**
29

310
* :doc:`Bugs </contributing/code/bugs>`

controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ Streaming File Responses
616616
You can use the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::file`
617617
helper to serve a file from inside a controller::
618618

619-
public function fileAction()
619+
public function download()
620620
{
621621
// send the file contents and force the browser to download it
622622
return $this->file('/path/to/some_file.pdf');
@@ -627,7 +627,7 @@ The ``file()`` helper provides some arguments to configure its behavior::
627627
use Symfony\Component\HttpFoundation\File\File;
628628
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
629629

630-
public function fileAction()
630+
public function download()
631631
{
632632
// load the file from the filesystem
633633
$file = new File('/path/to/some_file.pdf');

create_framework/http_kernel_controller_resolver.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class::
1010

1111
class LeapYearController
1212
{
13-
public function indexAction($request)
13+
public function index($request)
1414
{
1515
if (is_leap_year($request->attributes->get('year'))) {
1616
return new Response('Yep, this is a leap year!');
@@ -99,39 +99,39 @@ following interface::
9999
public function getArguments(Request $request, $controller);
100100
}
101101

102-
The ``indexAction()`` method needs the Request object as an argument.
102+
The ``index()`` method needs the Request object as an argument.
103103
``getArguments()`` knows when to inject it properly if it is type-hinted
104104
correctly::
105105

106-
public function indexAction(Request $request)
106+
public function index(Request $request)
107107

108108
// won't work
109-
public function indexAction($request)
109+
public function index($request)
110110

111111
More interesting, ``getArguments()`` is also able to inject any Request
112112
attribute; the argument just needs to have the same name as the corresponding
113113
attribute::
114114

115-
public function indexAction($year)
115+
public function index($year)
116116

117117
You can also inject the Request and some attributes at the same time (as the
118118
matching is done on the argument name or a type hint, the arguments order does
119119
not matter)::
120120

121-
public function indexAction(Request $request, $year)
121+
public function index(Request $request, $year)
122122

123-
public function indexAction($year, Request $request)
123+
public function index($year, Request $request)
124124

125125
Finally, you can also define default values for any argument that matches an
126126
optional attribute of the Request::
127127

128-
public function indexAction($year = 2012)
128+
public function index($year = 2012)
129129

130130
Let's just inject the ``$year`` request attribute for our controller::
131131

132132
class LeapYearController
133133
{
134-
public function indexAction($year)
134+
public function index($year)
135135
{
136136
if (is_leap_year($year)) {
137137
return new Response('Yep, this is a leap year!');

create_framework/http_kernel_httpkernel_class.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The error controller reads as follows::
9696

9797
class ErrorController
9898
{
99-
public function exceptionAction(FlattenException $exception)
99+
public function exception(FlattenException $exception)
100100
{
101101
$msg = 'Something went wrong! ('.$exception->getMessage().')';
102102

@@ -134,7 +134,7 @@ instead of a full Response object::
134134

135135
class LeapYearController
136136
{
137-
public function indexAction(Request $request, $year)
137+
public function index(Request $request, $year)
138138
{
139139
$leapYear = new LeapYear();
140140
if ($leapYear->isLeapYear($year)) {

create_framework/http_kernel_httpkernelinterface.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PHP; it implements ``HttpKernelInterface`` and wraps another
5454
``HttpKernelInterface`` instance::
5555

5656
// example.com/web/front.php
57-
57+
5858
// ..
5959

6060
$framework = new Simplex\Framework($dispatcher, $matcher, $controllerResolver, $argumentResolver);
@@ -74,7 +74,7 @@ to cache a response for 10 seconds, use the ``Response::setTtl()`` method::
7474
// example.com/src/Calendar/Controller/LeapYearController.php
7575

7676
// ...
77-
public function indexAction(Request $request, $year)
77+
public function index(Request $request, $year)
7878
{
7979
$leapYear = new LeapYear();
8080
if ($leapYear->isLeapYear($year)) {

create_framework/separation_of_concerns.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Move the controller to ``Calendar\Controller\LeapYearController``::
106106

107107
class LeapYearController
108108
{
109-
public function indexAction(Request $request, $year)
109+
public function index(Request $request, $year)
110110
{
111111
$leapYear = new LeapYear();
112112
if ($leapYear->isLeapYear($year)) {

0 commit comments

Comments
 (0)
0