Skip to content

Commit 7a04ed4

Browse files
committed
minor #6348 [best practices] mostly typos (Talita Kocjan Zager)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #6348). Discussion ---------- [best practices] mostly typos | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | x Commits ------- 68e3184 [best practices] mostly typos
2 parents adfc746 + 68e3184 commit 7a04ed4

File tree

7 files changed

+23
-29
lines changed

7 files changed

+23
-29
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 ``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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ 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.
5858
This lets you override translations defined in third-party bundles.
5959

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

0 commit comments

Comments
 (0)