Skip to content

Another collection of fixes: Typos, Formatting, Logic, Links #3174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dependency_injection/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Compiler passes to allow Interaction between Bundles
:ref:`Compiler passes <components-dependency-injection-compiler-passes>` are
used to allow interaction between different bundles as they cannot affect
each other's configuration in the extension classes. One of the main uses is
to process tagged services, allowing bundles to register services to picked
to process tagged services, allowing bundles to register services to be picked
up by other bundles, such as Monolog loggers, Twig extensions and Data Collectors
for the Web Profiler. Compiler passes are usually placed in the bundle's
``DependencyInjection/Compiler`` directory.
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ Sending the response to the client is then as simple as calling
Setting Cookies
~~~~~~~~~~~~~~~

The response cookies can be manipulated though the ``headers`` public
The response cookies can be manipulated through the ``headers`` public
attribute::

use Symfony\Component\HttpFoundation\Cookie;
Expand Down
2 changes: 1 addition & 1 deletion components/security/authorization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ An authorization decision will always be based on a few things:
Each attribute stands for a certain right the user should have, e.g.
``ROLE_ADMIN`` to make sure the user is an administrator.
* An object (optional)
Any object on which for which access control needs to be checked, like
Any object for which access control needs to be checked, like
an article or a comment object.

.. _components-security-access-decision-manager:
Expand Down
8 changes: 4 additions & 4 deletions components/security/firewall.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ Flow: Firewall, Authentication, Authorization
Hopefully you can now see a little bit about how the "flow" of the security
context works:

#. the Firewall is registered as a listener on the ``kernel.request`` event;
#. at the beginning of the request, the Firewall checks the firewall map
#. The Firewall is registered as a listener on the ``kernel.request`` event;
#. At the beginning of the request, the Firewall checks the firewall map
to see if any firewall should be active for this URL;
#. If a firewall is found in the map for this URL, its listeners are notified
#. each listener checks to see if the current request contains any authentication
#. If a firewall is found in the map for this URL, its listeners are notified;
#. Each listener checks to see if the current request contains any authentication
information - a listener may (a) authenticate a user, (b) throw an
``AuthenticationException``, or (c) do nothing (because there is no
authentication information on the request);
Expand Down
4 changes: 2 additions & 2 deletions cookbook/controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ the route ``_controller`` value:

# app/config/routing.yml
hello:
pattern: /hello
path: /hello
defaults: { _controller: acme.hello.controller:indexAction }

.. code-block:: xml

<!-- app/config/routing.xml -->
<route id="hello" pattern="/hello">
<route id="hello" path="/hello">
<default key="_controller">acme.hello.controller:indexAction</default>
</route>

Expand Down
8 changes: 4 additions & 4 deletions cookbook/doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ Next, update your routes. If you're placing your routes inside your bundle

# src/Acme/AccountBundle/Resources/config/routing.yml
account_register:
pattern: /register
defaults: { _controller: AcmeAccountBundle:Account:register }
path: /register
defaults: { _controller: AcmeAccountBundle:Account:register }

account_create:
pattern: /register/create
defaults: { _controller: AcmeAccountBundle:Account:create }
path: /register/create
defaults: { _controller: AcmeAccountBundle:Account:create }

.. code-block:: xml

Expand Down
2 changes: 1 addition & 1 deletion reference/configuration/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,6 @@ which is the first one defined or the one configured via the
``default_connection`` parameter.

Each connection is also accessible via the ``doctrine.dbal.[name]_connection``
service where ``[name]`` if the name of the connection.
service where ``[name]`` is the name of the connection.

.. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
4 changes: 2 additions & 2 deletions reference/configuration/swiftmailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ type

**type**: ``string`` **default**: ``file``

The method used to store spooled messages. Currently only ``file`` is supported.
However, a custom spool should be possible by creating a service called
The method used to store spooled messages. Valid values are ``memory`` and
``file``. A custom spool should be possible by creating a service called
``swiftmailer.spool.myspool`` and setting this value to ``myspool``.

path
Expand Down
6 changes: 3 additions & 3 deletions reference/constraints/False.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ method returns **false**:
Acme\BlogBundle\Entity\Author
getters:
stateInvalid:
- "False":
- 'False':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a standard? I'm more accustomed to seeing double-quotes in YAML. Or is it that double-quotes in YAML makes this still equate to a boolean (instead of the string)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, I'm more used to double quotes in this context. It is just to make it consistent between the True, False and Null validator descriptions. And no, a double quoted string does not evaluate to the Boolean value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for using double quoted YAML strings here. The True and Null validators can be changed alike if this was necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Yaml component uses single quotes to escape the reserved names in Yaml. I think we should use that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wouterj Just wanted to check what the Yaml component does for reference ;-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, what's the reason for using single quotes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you can see both in core :)

https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml#L6

https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml#L40

The same is true of config.yml in the standard edition. So, since it doesn't matter, let's just be as consistent as we can. Since True and Null are using single quotes, let's just keep this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, True and False are using double quotes - Null was not. So in the first version I changed Null to use double quotes. Now, in this PR, everything is updated to single quote. Since it doesn't matter, we can go ahead with single quotes.

message: You've entered an invalid state.

.. code-block:: php-annotations
Expand Down Expand Up @@ -103,8 +103,8 @@ method returns **false**:

.. caution::

When using YAML, be sure to surround ``False`` with quotes (``"False"``)
or else YAML will convert this into a Boolean value.
When using YAML, be sure to surround ``False`` with quotes (``'False'``)
or else YAML will convert this into a ``false`` Boolean value.

Options
-------
Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/File.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ If set, the validator will check that the mime type of the underlying file
is equal to the given mime type (if a string) or exists in the collection
of given mime types (if an array).

You can find a list of existing mime types on the `IANA website`_
You can find a list of existing mime types on the `IANA website`_.

maxSizeMessage
~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ is used.
minMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``This value is too short. It should have {{ limit }} characters or more.``.
**type**: ``string`` **default**: ``This value is too short. It should have {{ limit }} characters or more.``

The message that will be shown if the underlying value's length is less than the `min`_ option.

maxMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``This value is too long. It should have {{ limit }} characters or less.``.
**type**: ``string`` **default**: ``This value is too long. It should have {{ limit }} characters or less.``

The message that will be shown if the underlying value's length is more than the `max`_ option.

Expand Down
5 changes: 5 additions & 0 deletions reference/constraints/Null.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ of an ``Author`` class exactly equal to ``null``, you could do the following:
}
}

.. caution::

When using YAML, be sure to surround ``Null`` with quotes (``'Null'``)
or else YAML will convert this into a ``null`` value.

Options
-------

Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Regex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ will convert the pattern given in the `pattern`_ option into an HTML5 compatible
pattern. This means that the delimiters are removed (e.g. ``/[a-z]+/`` becomes ``[a-z]+``).

However, there are some other incompatibilities between both patterns which
cannot be fixed by the constraint. For instance, the html5 pattern attribute
cannot be fixed by the constraint. For instance, the HTML5 ``pattern`` attribute
does not support flags. If you have a pattern like ``/[a-z]+/i`` you need to
specify the html5 compatible pattern in the ``htmlPattern`` option:
specify the HTML5 compatible pattern in the ``htmlPattern`` option:

.. configuration-block::

Expand Down
7 changes: 6 additions & 1 deletion reference/constraints/True.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Then you can constrain this method with ``True``.
Acme\BlogBundle\Entity\Author:
getters:
tokenValid:
- "True": { message: "The token is invalid." }
- 'True': { message: "The token is invalid." }

.. code-block:: php-annotations

Expand Down Expand Up @@ -116,6 +116,11 @@ Then you can constrain this method with ``True``.

If the ``isTokenValid()`` returns false, the validation will fail.

.. caution::

When using YAML, be sure to surround ``True`` with quotes (``'True'``)
or else YAML will convert this into a ``true`` Boolean value.

Options
-------

Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/UniqueEntity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ errorPath
.. versionadded:: 2.1
The ``errorPath`` option was added in Symfony 2.1.

If the entity violates constraint the error message is bound to the first
field in `fields`_. If there are more than one fields, you may want to map
If the entity violates the constraint the error message is bound to the first
field in `fields`_. If there is more than one field, you may want to map
the error message to another field.

Consider this example:
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ you need is the JavaScript:
is automatically available on the ``data-prototype`` attribute of the
element (e.g. ``div`` or ``table``) that surrounds your collection. The
only difference is that the entire "form row" is rendered for you, meaning
you wouldn't have to wrap it in any container element as was done
you wouldn't have to wrap it in any container element as it was done
above.

Field Options
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/integer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This field has different options on how to handle input values that aren't
integers. By default, all non-integer values (e.g. 6.78) will round down (e.g. 6).

+-------------+-----------------------------------------------------------------------+
| Rendered as | ``input`` ``text`` field |
| Rendered as | ``input`` ``number`` field |
+-------------+-----------------------------------------------------------------------+
| Options | - `rounding_mode`_ |
| | - `precision`_ |
Expand Down
6 changes: 3 additions & 3 deletions reference/forms/types/options/attr.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ attr

**type**: array **default**: Empty array

If you want to add extra attributes to HTML field representation
you can use ``attr`` option. It's an associative array with HTML attribute
as a key. This can be useful when you need to set a custom class for some widget::
If you want to add extra attributes to an HTML field representation
you can use the ``attr`` option. It's an associative array with HTML attributes
as keys. This can be useful when you need to set a custom class for some widget::

$builder->add('body', 'textarea', array(
'attr' => array('class' => 'tinymce'),
Expand Down
8 changes: 4 additions & 4 deletions reference/forms/types/options/date_widget.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ widget

The basic way in which this field should be rendered. Can be one of the following:

* ``choice``: renders three select inputs. The order of the selects is defined
* ``choice``: renders three select inputs. The order of the selects is defined
in the `format`_ option.

* ``text``: renders a three field input of type text (month, day, year).
* ``text``: renders a three field input of type ``text`` (month, day, year).

* ``single_text``: renders a single input of type date (text in Symfony 2.0). User's
input is validated based on the `format`_ option.
* ``single_text``: renders a single input of type ``date`` (``text`` in Symfony 2.0).
User's input is validated based on the `format`_ option.
6 changes: 3 additions & 3 deletions reference/forms/types/options/error_mapping.rst.inc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.. versionadded:: 2.1
The ``error_mapping`` option is new to Symfony 2.1.

error_mapping
~~~~~~~~~~~~~

**type**: ``array`` **default**: ``empty``

.. versionadded:: 2.1
The ``error_mapping`` option is new to Symfony 2.1.

This option allows you to modify the target of a validation error.

Imagine you have a custom method named ``matchingCityAndZipCode`` that validates
Expand Down