Skip to content

Commit 82ba7db

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: [#6219] some tweaks Point that route parameters are also Request attributes [#6348] some minor tweaks [best practices] mostly typos [#6275] some minor tweaks [quick tour] mostly typos remove link-local IPv6 address (fe80::1) [#6305] move link reference to the bottom Mention IvoryCKEditorBundle in the Symfony Forms doc [#6328] minor tweak Update extension.rst - added caution box for people trying to remove the default file with services definitions Altered single / multiple inheritance sentence Replace XLIFF number ids by strings
2 parents a84b2c5 + 72b47e1 commit 82ba7db

File tree

19 files changed

+112
-87
lines changed

19 files changed

+112
-87
lines changed

best_practices/business-logic.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ The three entities defined by our sample blog application are a good example:
193193
Doctrine Mapping Information
194194
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
195195

196-
Doctrine Entities are plain PHP objects that you store in some "database".
196+
Doctrine entities are plain PHP objects that you store in some "database".
197197
Doctrine only knows about your entities through the mapping metadata configured
198198
for your model classes. Doctrine supports four metadata formats: YAML, XML,
199199
PHP and annotations.

best_practices/configuration.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ If you've done something like this in the past, it's likely that you've in fact
107107
*never* actually needed to change that value. Creating a configuration
108108
option for a value that you are never going to configure just isn't necessary.
109109
Our recommendation is to define these values as constants in your application.
110-
You could, for example, define a ``NUM_ITEMS`` constant in the ``Post`` entity:
111-
112-
.. code-block:: php
110+
You could, for example, define a ``NUM_ITEMS`` constant in the ``Post`` entity::
113111

114112
// src/AppBundle/Entity/Post.php
115113
namespace AppBundle\Entity;

best_practices/controllers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Template Configuration
7373

7474
.. best-practice::
7575

76-
Don't use the ``@Template()`` annotation to configure the template used by
76+
Don't use the ``@Template`` annotation to configure the template used by
7777
the controller.
7878

7979
The ``@Template`` annotation is useful, but also involves some magic. We
@@ -148,7 +148,7 @@ For example:
148148
));
149149
}
150150
151-
Normally, you'd expect a ``$id`` argument to ``showAction``. Instead, by
151+
Normally, you'd expect a ``$id`` argument to ``showAction()``. Instead, by
152152
creating a new argument (``$post``) and type-hinting it with the ``Post``
153153
class (which is a Doctrine entity), the ParamConverter automatically queries
154154
for an object whose ``$id`` property matches the ``{id}`` value. It will

best_practices/creating-the-project.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ProductBundle, then there's no advantage to having two separate bundles.
104104

105105
.. best-practice::
106106

107-
Create only one bundle called AppBundle for your application logic
107+
Create only one bundle called AppBundle for your application logic.
108108

109109
Implementing a single AppBundle bundle in your projects will make your code
110110
more concise and easier to understand. Starting in Symfony 2.6, the official
@@ -179,8 +179,6 @@ The changes are pretty superficial, but for now, we recommend that you use
179179
the Symfony directory structure.
180180

181181
.. _`Composer`: https://getcomposer.org/
182-
.. _`Get Started`: https://getcomposer.org/doc/00-intro.md
183-
.. _`Composer download page`: https://getcomposer.org/download/
184-
.. _`public checksums repository`: https://github.com/sensiolabs/checksums
185-
.. _`these steps`: http://fabien.potencier.org/signing-project-releases.html
186182
.. _`Phar extension`: http://php.net/manual/en/intro.phar.php
183+
.. _`public checksums repository`: https://github.com/sensiolabs/checksums
184+
.. _`these steps`: http://fabien.potencier.org/signing-project-releases.html

best_practices/forms.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ form in its own PHP class::
5454
Put the form type classes in the ``AppBundle\Form`` namespace, unless you
5555
use other custom form classes like data transformers.
5656

57-
To use the class, use ``createForm`` and instantiate the new class::
57+
To use the class, use ``createForm()`` and instantiate the new class::
5858

5959
// ...
6060
use AppBundle\Form\PostType;
@@ -160,8 +160,8 @@ thing in one line to rendering each part of each field independently. The
160160
best way depends on how much customization you need.
161161

162162
One of the simplest ways - which is especially useful during development -
163-
is to render the form tags and use ``form_widget()`` to render all of the
164-
fields:
163+
is to render the form tags and use the ``form_widget()`` function to render
164+
all of the fields:
165165

166166
.. code-block:: html+twig
167167

@@ -171,7 +171,7 @@ fields:
171171

172172
If you need more control over how your fields are rendered, then you should
173173
remove the ``form_widget(form)`` function and render your fields individually.
174-
See the :doc:`/cookbook/form/form_customization` article for more information
174+
See the :doc:`/cookbook/form/form_customization` cookbook article for more information
175175
on this and how you can control *how* the form renders at a global level
176176
using form theming.
177177

@@ -204,9 +204,9 @@ Handling a form submit usually follows a similar template:
204204
205205
There are really only two notable things here. First, we recommend that you
206206
use a single action for both rendering the form and handling the form submit.
207-
For example, you *could* have a ``newAction`` that *only* renders the form
208-
and a ``createAction`` that *only* processes the form submit. Both those
209-
actions will be almost identical. So it's much simpler to let ``newAction``
207+
For example, you *could* have a ``newAction()`` that *only* renders the form
208+
and a ``createAction()`` that *only* processes the form submit. Both those
209+
actions will be almost identical. So it's much simpler to let ``newAction()``
210210
handle everything.
211211

212212
Second, we recommend using ``$form->isSubmitted()`` in the ``if`` statement

best_practices/i18n.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ Translation Source File Location
4747

4848
.. best-practice::
4949

50-
Store the translation files in the ``app/Resources/translations/`` directory.
50+
Store the translation files in the ``app/Resources/translations/``
51+
directory.
5152

5253
Traditionally, Symfony developers have created these files in the
53-
``Resources/translations/`` directory of each bundle.
54-
55-
But since the ``app/Resources/`` directory is considered the global location
56-
for the application's resources, storing translations in ``app/Resources/translations/``
54+
``Resources/translations/`` directory of each bundle. But since the
55+
``app/Resources/`` directory is considered the global location for the
56+
application's resources, storing translations in ``app/Resources/translations/``
5757
centralizes them *and* gives them priority over any other translation file.
58-
This lets you override translations defined in third-party bundles.
58+
This let's you override translations defined in third-party bundles.
5959

6060
Translation Keys
6161
----------------
@@ -85,7 +85,7 @@ English in the application would be:
8585
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
8686
<file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
8787
<body>
88-
<trans-unit id="1">
88+
<trans-unit id="title_post_list">
8989
<source>title.post_list</source>
9090
<target>Post List</target>
9191
</trans-unit>

best_practices/tests.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ functional tests, you can quickly spot any big errors before you deploy them:
2626
Define a functional test that at least checks if your application pages
2727
are successfully loading.
2828

29-
A functional test can be as easy as this:
30-
31-
.. code-block:: php
29+
A functional test can be as easy as this::
3230

3331
// src/AppBundle/Tests/ApplicationAvailabilityFunctionalTest.php
3432
namespace AppBundle\Tests;
@@ -116,10 +114,10 @@ Learn More about Functional Tests
116114
Consider using the `HautelookAliceBundle`_ to generate real-looking data for
117115
your test fixtures using `Faker`_ and `Alice`_.
118116

119-
.. _`Faker`: https://github.com/fzaninotto/Faker
120-
.. _`Alice`: https://github.com/nelmio/alice
121117
.. _`PhpUnit`: https://phpunit.de/
122118
.. _`PhpSpec`: http://www.phpspec.net/
123-
.. _`Mink`: http://mink.behat.org
124119
.. _`smoke testing`: https://en.wikipedia.org/wiki/Smoke_testing_(software)
120+
.. _`Mink`: http://mink.behat.org
125121
.. _`HautelookAliceBundle`: https://github.com/hautelook/AliceBundle
122+
.. _`Faker`: https://github.com/fzaninotto/Faker
123+
.. _`Alice`: https://github.com/nelmio/alice

book/translation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ different formats, XLIFF being the recommended format:
134134
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
135135
<file source-language="en" datatype="plaintext" original="file.ext">
136136
<body>
137-
<trans-unit id="1">
137+
<trans-unit id="symfony_is_great">
138138
<source>Symfony is great</source>
139139
<target>J'aime Symfony</target>
140140
</trans-unit>
@@ -671,7 +671,7 @@ bundle.
671671
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
672672
<file source-language="en" datatype="plaintext" original="file.ext">
673673
<body>
674-
<trans-unit id="1">
674+
<trans-unit id="author.name.not_blank">
675675
<source>author.name.not_blank</source>
676676
<target>Please enter an author name.</target>
677677
</trans-unit>

components/event_dispatcher/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ answer.
2222
Consider the real-world example where you want to provide a plugin system
2323
for your project. A plugin should be able to add methods, or do something
2424
before or after a method is executed, without interfering with other plugins.
25-
This is not an easy problem to solve with single and multiple inheritance
26-
(were it possible with PHP) has its own drawbacks.
25+
This is not an easy problem to solve with single inheritance, and even if
26+
multiple inheritance was possible with PHP, it comes with its own drawbacks.
2727

2828
The Symfony EventDispatcher component implements the `Mediator`_ pattern
2929
in a simple and effective way to make all these things possible and to make

components/translation/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ recommended format. These files are parsed by one of the loader classes.
115115
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
116116
<file source-language="en" datatype="plaintext" original="file.ext">
117117
<body>
118-
<trans-unit id="1">
118+
<trans-unit id="symfony_is_great">
119119
<source>Symfony is great</source>
120120
<target>J'aime Symfony</target>
121121
</trans-unit>
122-
<trans-unit id="2">
122+
<trans-unit id="symfony.great">
123123
<source>symfony.great</source>
124124
<target>J'aime Symfony</target>
125125
</trans-unit>

0 commit comments

Comments
 (0)