Skip to content

[Reference][Constraints] Remove invalid default option markers; fix messages #3178

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 1 commit into from
Nov 16, 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 reference/constraints/Blank.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value should be blank``
**type**: ``string`` **default**: ``This value should be blank.``

This is the message that will be shown if the value is not blank.
2 changes: 1 addition & 1 deletion reference/constraints/CardScheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ For more information about the used schemes, see `Wikipedia: Issuer identificati
message
~~~~~~~

**type**: ``string`` **default**: ``Unsupported card type or invalid card number``
**type**: ``string`` **default**: ``Unsupported card type or invalid card number.``

The message shown when the value does not pass the ``CardScheme`` check.

Expand Down
8 changes: 4 additions & 4 deletions reference/constraints/Choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,15 @@ will fail.
message
~~~~~~~

**type**: ``string`` **default**: ``The value you selected is not a valid choice``
**type**: ``string`` **default**: ``The value you selected is not a valid choice.``

This is the message that you will receive if the ``multiple`` option is set
to ``false``, and the underlying value is not in the valid array of choices.

multipleMessage
~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``One or more of the given values is invalid``
**type**: ``string`` **default**: ``One or more of the given values is invalid.``

This is the message that you will receive if the ``multiple`` option is set
to ``true``, and one of the values on the underlying array being checked
Expand All @@ -328,15 +328,15 @@ is not in the array of valid choices.
minMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``You must select at least {{ limit }} choices``
**type**: ``string`` **default**: ``You must select at least {{ limit }} choices.``

This is the validation error message that's displayed when the user chooses
too few choices per the `min`_ option.

maxMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``You must select at most {{ limit }} choices``
**type**: ``string`` **default**: ``You must select at most {{ limit }} choices.``

This is the validation error message that's displayed when the user chooses
too many options per the `max`_ option.
Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ error will be returned. If set to ``true``, extra fields are ok.
extraFieldsMessage
~~~~~~~~~~~~~~~~~~

**type**: ``Boolean`` **default**: ``The fields {{ fields }} were not expected``
**type**: ``Boolean`` **default**: ``The fields {{ fields }} were not expected.``

The message shown if `allowExtraFields`_ is false and an extra field is detected.

Expand All @@ -322,7 +322,7 @@ option are not present in the underlying collection.
missingFieldsMessage
~~~~~~~~~~~~~~~~~~~~

**type**: ``Boolean`` **default**: ``The fields {{ fields }} are missing``
**type**: ``Boolean`` **default**: ``The fields {{ fields }} are missing.``

The message shown if `allowMissingFields`_ is false and one or more fields
are missing from the underlying collection.
10 changes: 5 additions & 5 deletions reference/constraints/Count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,37 +108,37 @@ Options
min
~~~

**type**: ``integer`` [:ref:`default option <validation-default-option>`]
**type**: ``integer``

This required option is the "min" count value. Validation will fail if the given
collection elements count is **less** than this min value.

max
~~~

**type**: ``integer`` [:ref:`default option <validation-default-option>`]
**type**: ``integer``

This required option is the "max" count value. Validation will fail if the given
collection elements count is **greater** than this max value.

minMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or more.``.
**type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or more.``

The message that will be shown if the underlying collection elements count is less than the `min`_ option.

maxMessage
~~~~~~~~~~

**type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or less.``.
**type**: ``string`` **default**: ``This collection should contain {{ limit }} elements or less.``

The message that will be shown if the underlying collection elements count is more than the `max`_ option.

exactMessage
~~~~~~~~~~~~

**type**: ``string`` **default**: ``This collection should contain exactly {{ limit }} elements.``.
**type**: ``string`` **default**: ``This collection should contain exactly {{ limit }} elements.``

The message that will be shown if min and max values are equal and the underlying collection elements
count is not exactly this value.
2 changes: 1 addition & 1 deletion reference/constraints/Country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid country``
**type**: ``string`` **default**: ``This value is not a valid country.``

This message is shown if the string is not a valid country code.
2 changes: 1 addition & 1 deletion reference/constraints/Date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid date``
**type**: ``string`` **default**: ``This value is not a valid date.``

This message is shown if the underlying data is not a valid date.
2 changes: 1 addition & 1 deletion reference/constraints/DateTime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid datetime``
**type**: ``string`` **default**: ``This value is not a valid datetime.``

This message is shown if the underlying data is not a valid datetime.
2 changes: 1 addition & 1 deletion reference/constraints/Email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid email address``
**type**: ``string`` **default**: ``This value is not a valid email address.``

This message is shown if the underlying data is not a valid email address.

Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/False.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value should be false``
**type**: ``string`` **default**: ``This value should be false.``

This message is shown if the underlying data is not false.
14 changes: 7 additions & 7 deletions reference/constraints/File.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,22 @@ You can find a list of existing mime types on the `IANA website`_
maxSizeMessage
~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file is too large ({{ size }}). Allowed maximum size is {{ limit }}``
**type**: ``string`` **default**: ``The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.``

The message displayed if the file is larger than the `maxSize`_ option.

mimeTypesMessage
~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}``
**type**: ``string`` **default**: ``The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.``

The message displayed if the mime type of the file is not a valid mime type
per the `mimeTypes`_ option.

notFoundMessage
~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file could not be found``
**type**: ``string`` **default**: ``The file could not be found.``

The message displayed if no file can be found at the given path. This error
is only likely if the underlying value is a string path, as a ``File`` object
Expand All @@ -206,31 +206,31 @@ cannot be constructed with an invalid file path.
notReadableMessage
~~~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file is not readable``
**type**: ``string`` **default**: ``The file is not readable.``

The message displayed if the file exists, but the PHP ``is_readable`` function
fails when passed the path to the file.

uploadIniSizeErrorMessage
~~~~~~~~~~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file is too large. Allowed maximum size is {{ limit }}``
**type**: ``string`` **default**: ``The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.``

The message that is displayed if the uploaded file is larger than the ``upload_max_filesize``
``php.ini`` setting.

uploadFormSizeErrorMessage
~~~~~~~~~~~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file is too large``
**type**: ``string`` **default**: ``The file is too large.``

The message that is displayed if the uploaded file is larger than allowed
by the HTML file input field.

uploadErrorMessage
~~~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The file could not be uploaded``
**type**: ``string`` **default**: ``The file could not be uploaded.``

The message that is displayed if the uploaded file could not be uploaded
for some unknown reason, such as the file upload failed or it couldn't be written
Expand Down
12 changes: 6 additions & 6 deletions reference/constraints/Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ You can find a list of existing image mime types on the `IANA website`_
mimeTypesMessage
~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``This file is not a valid image``
**type**: ``string`` **default**: ``This file is not a valid image.``

.. versionadded:: 2.1
All of the min/max width/height options are new to Symfony 2.1.
Expand Down Expand Up @@ -200,7 +200,7 @@ value in pixels.
sizeNotDetectedMessage
~~~~~~~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The size of the image could not be detected``
**type**: ``string`` **default**: ``The size of the image could not be detected.``

If the system is unable to determine the size of the image, this error will
be displayed. This will only occur when at least one of the four size constraint
Expand All @@ -209,28 +209,28 @@ options has been set.
maxWidthMessage
~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px``
**type**: ``string`` **default**: ``The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.``

The error message if the width of the image exceeds `maxWidth`_.

minWidthMessage
~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px``
**type**: ``string`` **default**: ``The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.``

The error message if the width of the image is less than `minWidth`_.

maxHeightMessage
~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px``
**type**: ``string`` **default**: ``The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.``

The error message if the height of the image exceeds `maxHeight`_.

minHeightMessage
~~~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px``
**type**: ``string`` **default**: ``The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.``

The error message if the height of the image is less than `minHeight`_.

Expand Down
2 changes: 1 addition & 1 deletion reference/constraints/Ip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ of a variety of different values:
message
~~~~~~~

**type**: ``string`` **default**: ``This is not a valid IP address``
**type**: ``string`` **default**: ``This is not a valid IP address.``

This message is shown if the string is not a valid IP address.
2 changes: 1 addition & 1 deletion reference/constraints/Language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid language``
**type**: ``string`` **default**: ``This value is not a valid language.``

This message is shown if the string is not a valid language code.
10 changes: 5 additions & 5 deletions reference/constraints/Length.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ Options
min
~~~

**type**: ``integer`` [:ref:`default option <validation-default-option>`]
**type**: ``integer``

This required option is the "min" length value. Validation will fail if the given
value's length is **less** than this min value.

max
~~~

**type**: ``integer`` [:ref:`default option <validation-default-option>`]
**type**: ``integer``

This required option is the "max" length value. Validation will fail if the given
value's length is **greater** than this max value.
Expand All @@ -134,21 +134,21 @@ 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.

exactMessage
~~~~~~~~~~~~

**type**: ``string`` **default**: ``This value should have exactly {{ limit }} characters.``.
**type**: ``string`` **default**: ``This value should have exactly {{ limit }} characters.``

The message that will be shown if min and max values are equal and the underlying
value's length is not exactly this value.
2 changes: 1 addition & 1 deletion reference/constraints/Locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ Options
message
~~~~~~~

**type**: ``string`` **default**: ``This value is not a valid locale``
**type**: ``string`` **default**: ``This value is not a valid locale.``

This message is shown if the string is not a valid locale.
2 changes: 1 addition & 1 deletion reference/constraints/Luhn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Available Options
message
~~~~~~~

**type**: ``string`` **default**: ``Invalid card number``
**type**: ``string`` **default**: ``Invalid card number.``

The default message supplied when the value does not pass the Luhn check.

Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Max.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ value is **greater** than this max value.
message
~~~~~~~

**type**: ``string`` **default**: ``This value should be {{ limit }} or less``
**type**: ``string`` **default**: ``This value should be {{ limit }} or less.``

The message that will be shown if the underlying value is greater than the
`limit`_ option.

invalidMessage
~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``This value should be a valid number``
**type**: ``string`` **default**: ``This value should be a valid number.``

The message that will be shown if the underlying value is not a number (per
the :phpfunction:`is_numeric` PHP function).
2 changes: 1 addition & 1 deletion reference/constraints/MaxLength.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ of the give string is **greater** than this number.
message
~~~~~~~

**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 string has a length that
is longer than the `limit`_ option.
Expand Down
4 changes: 2 additions & 2 deletions reference/constraints/Min.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ value is **less** than this min value.
message
~~~~~~~

**type**: ``string`` **default**: ``This value should be {{ limit }} or more``
**type**: ``string`` **default**: ``This value should be {{ limit }} or more.``

The message that will be shown if the underlying value is less than the `limit`_
option.

invalidMessage
~~~~~~~~~~~~~~

**type**: ``string`` **default**: ``This value should be a valid number``
**type**: ``string`` **default**: ``This value should be a valid number.``

The message that will be shown if the underlying value is not a number (per
the :phpfunction:`is_numeric` PHP function).
2 changes: 1 addition & 1 deletion reference/constraints/MinLength.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ of the give string is **less** than this number.
message
~~~~~~~

**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 string has a length that
is shorter than the `limit`_ option.
Expand Down
Loading