Skip to content

Commit

Permalink
minor #6348 [best practices] mostly typos (Talita Kocjan Zager)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xabbuh committed Mar 11, 2016
2 parents adfc746 + 68e3184 commit 7a04ed4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 29 deletions.
2 changes: 1 addition & 1 deletion best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ The three entities defined by our sample blog application are a good example:
Doctrine Mapping Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Doctrine Entities are plain PHP objects that you store in some "database".
Doctrine entities are plain PHP objects that you store in some "database".
Doctrine only knows about your entities through the mapping metadata configured
for your model classes. Doctrine supports four metadata formats: YAML, XML,
PHP and annotations.
Expand Down
4 changes: 1 addition & 3 deletions best_practices/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ If you've done something like this in the past, it's likely that you've in fact
*never* actually needed to change that value. Creating a configuration
option for a value that you are never going to configure just isn't necessary.
Our recommendation is to define these values as constants in your application.
You could, for example, define a ``NUM_ITEMS`` constant in the ``Post`` entity:

.. code-block:: php
You could, for example, define a ``NUM_ITEMS`` constant in the ``Post`` entity::

// src/AppBundle/Entity/Post.php
namespace AppBundle\Entity;
Expand Down
4 changes: 2 additions & 2 deletions best_practices/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Template Configuration

.. best-practice::

Don't use the ``@Template()`` annotation to configure the template used by
Don't use the ``@Template`` annotation to configure the template used by
the controller.

The ``@Template`` annotation is useful, but also involves some magic. We
Expand Down Expand Up @@ -148,7 +148,7 @@ For example:
));
}
Normally, you'd expect a ``$id`` argument to ``showAction``. Instead, by
Normally, you'd expect a ``$id`` argument to ``showAction()``. Instead, by
creating a new argument (``$post``) and type-hinting it with the ``Post``
class (which is a Doctrine entity), the ParamConverter automatically queries
for an object whose ``$id`` property matches the ``{id}`` value. It will
Expand Down
8 changes: 3 additions & 5 deletions best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ProductBundle, then there's no advantage to having two separate bundles.

.. best-practice::

Create only one bundle called AppBundle for your application logic
Create only one bundle called AppBundle for your application logic.

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

.. _`Composer`: https://getcomposer.org/
.. _`Get Started`: https://getcomposer.org/doc/00-intro.md
.. _`Composer download page`: https://getcomposer.org/download/
.. _`public checksums repository`: https://github.com/sensiolabs/checksums
.. _`these steps`: http://fabien.potencier.org/signing-project-releases.html
.. _`Phar extension`: http://php.net/manual/en/intro.phar.php
.. _`public checksums repository`: https://github.com/sensiolabs/checksums
.. _`these steps`: http://fabien.potencier.org/signing-project-releases.html
14 changes: 7 additions & 7 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ form in its own PHP class::
Put the form type classes in the ``AppBundle\Form`` namespace, unless you
use other custom form classes like data transformers.

To use the class, use ``createForm`` and instantiate the new class::
To use the class, use ``createForm()`` and instantiate the new class::

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

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

.. code-block:: html+twig

Expand All @@ -171,7 +171,7 @@ fields:

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

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

Second, we recommend using ``$form->isSubmitted()`` in the ``if`` statement
Expand Down
10 changes: 5 additions & 5 deletions best_practices/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ Translation Source File Location

.. best-practice::

Store the translation files in the ``app/Resources/translations/`` directory.
Store the translation files in the ``app/Resources/translations/``
directory.

Traditionally, Symfony developers have created these files in the
``Resources/translations/`` directory of each bundle.

But since the ``app/Resources/`` directory is considered the global location
for the application's resources, storing translations in ``app/Resources/translations/``
``Resources/translations/`` directory of each bundle. But since the
``app/Resources/`` directory is considered the global location for the
application's resources, storing translations in ``app/Resources/translations/``
centralizes them *and* gives them priority over any other translation file.
This lets you override translations defined in third-party bundles.

Expand Down
10 changes: 4 additions & 6 deletions best_practices/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ functional tests, you can quickly spot any big errors before you deploy them:
Define a functional test that at least checks if your application pages
are successfully loading.

A functional test can be as easy as this:

.. code-block:: php
A functional test can be as easy as this::

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

.. _`Faker`: https://github.com/fzaninotto/Faker
.. _`Alice`: https://github.com/nelmio/alice
.. _`PhpUnit`: https://phpunit.de/
.. _`PhpSpec`: http://www.phpspec.net/
.. _`Mink`: http://mink.behat.org
.. _`smoke testing`: https://en.wikipedia.org/wiki/Smoke_testing_(software)
.. _`Mink`: http://mink.behat.org
.. _`HautelookAliceBundle`: https://github.com/hautelook/AliceBundle
.. _`Faker`: https://github.com/fzaninotto/Faker
.. _`Alice`: https://github.com/nelmio/alice

0 comments on commit 7a04ed4

Please sign in to comment.