8000 Sort all validator constraints options by javiereguiluz · Pull Request #11101 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Sort all validator constraints options #11101

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

Closed
wants to merge 3 commits into from
Closed
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
19 changes: 8 additions & 11 deletions reference/constraints/All.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@ All
When applied to an array (or Traversable object), this constraint allows
you to apply a collection of constraints to each element of the array.

+----------------+-------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
+----------------+-------------------------------------------------------------------+
| Options | - `constraints`_ |
| | - `groups`_ |
| | - `payload`_ |
+----------------+-------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\All` |
+----------------+-------------------------------------------------------------------+
| Validator | :class:`Symfony\\Component\\Validator\\Constraints\\AllValidator` |
+----------------+-------------------------------------------------------------------+
========== ===================================================================
Applies to :ref:`property or method <validation-property-target>`
Options - `constraints`_
- `groups`_
- `payload`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\All`
Validator :class:`Symfony\\Component\\Validator\\Constraints\\AllValidator`
========== ===================================================================

Basic Usage
-----------
Expand Down
59 changes: 28 additions & 31 deletions reference/constraints/Bic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@ This constraint is used to ensure that a value has the proper format of a
uniquely identify both financial and non-financial institutions. You may also
check that the BIC is associated with a given IBAN.

+----------------+-----------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
+----------------+-----------------------------------------------------------------------+
| Options | - `groups`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `iban`_ |
| | - `ibanMessage`_ |
| | - `ibanPropertyPath`_ |
+----------------+-----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Bic` |
+----------------+-----------------------------------------------------------------------+
| Validator | :class:`Symfony\\Component\\Validator\\Constraints\\BicValidator` |
+----------------+-----------------------------------------------------------------------+
========== ===================================================================
Applies to :ref:`property or method <validation-property-target>`
Options - `groups`_
- `iban`_
- `ibanMessage`_
- `ibanPropertyPath`_
- `message`_
- `payload`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\Bic`
Validator :class:`Symfony\\Component\\Validator\\Constraints\\BicValidator`
========== ===================================================================

Basic Usage
-----------
Expand Down Expand Up @@ -92,23 +89,6 @@ Available Options

.. include:: /reference/constraints/_groups-option.rst.inc

message
~~~~~~~

**type**: ``string`` **default**: ``This is not a valid Business Identifier Code (BIC).``

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) BIC value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

iban
~~~~

Expand All @@ -134,4 +114,21 @@ For example, if you want to compare the ``$bic`` property of some object
with reg 629A ard to the ``$iban`` property of the same object, use
``propertyPath="iban"`` in the comparison constraint of ``$bic``.

message
~~~~~~~

**type**: ``string`` **default**: ``This is not a valid Business Identifier Code (BIC).``

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

You can use the following parameters in this message:

=============== ==============================================================
Parameter Description
=============== ==============================================================
``{{ value }}`` The current (invalid) BIC value
=============== ==============================================================

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`Business Identifier Code (BIC)`: https://en.wikipedia.org/wiki/Business_Identifier_Code
29 changes: 13 additions & 16 deletions reference/constraints/Blank.rst
A92E
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@ To force that a value strictly be equal to ``null``, see the
To force that a value is *not* blank, see :doc:`/reference/constraints/NotBlank`.
But be careful as ``NotBlank`` is *not* strictly the opposite of ``Blank``.

+----------------+---------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
+----------------+---------------------------------------------------------------------+
| Options | - `groups`_ |
| | - `message`_ |
| | - `payload`_ |
+----------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Blank` |
+----------------+---------------------------------------------------------------------+
| Validator | :class:`Symfony\\Component\\Validator\\Constraints\\BlankValidator` |
+----------------+---------------------------------------------------------------------+
========== ===================================================================
Applies to :ref:`property or method <validation-property-target>`
Options - `groups`_
- `message`_
- `payload`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\Blank`
Validator :class:`Symfony\\Component\\Validator\\Constraints\\BlankValidator`
========== ===================================================================

Basic Usage
-----------
Expand Down Expand Up @@ -101,10 +98,10 @@ This is the message that will be shown if the value is not blank.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+
=============== ==============================================================
Parameter Description
=============== ==============================================================
``{{ value }}`` The current (invalid) value
=============== ==============================================================

.. include:: /reference/constraints/_payload-option.rst.inc
19 changes: 8 additions & 11 deletions reference/constraints/Callback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ can do anything, including creating and assigning validation errors.
as you'll see in the example, a callback method has the ability to directly
add validator "violations".

+----------------+------------------------------------------------------------------------+
| Applies to | :ref:`class <validation-class-target>` |
+----------------+------------------------------------------------------------------------+
| Options | - :ref:`callback <callback-option>` |
| | - `groups`_ |
| | - `payload`_ |
+----------------+------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Callback` |
+----------------+------------------------------------------------------------------------+
| Validator | :class:`Symfony\\Component\\Validator\\Constraints\\CallbackValidator` |
+----------------+------------------------------------------------------------------------+
========== ===================================================================
Applies to :ref:`class <validation-class-target>`
Options - :ref:`callback <callback-option>`
- `groups`_
- `payload`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\Callback`
Validator :class:`Symfony\\Component\\Validator\\Constraints\\CallbackValidator`
========== ===================================================================

Configuration
-------------
Expand Down
55 changes: 26 additions & 29 deletions reference/constraints/CardScheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@ This constraint ensures that a credit card number is valid for a given credit
card company. It can be used to validate the number before trying to initiate
a payment through a payment gateway.

+----------------+--------------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
+----------------+--------------------------------------------------------------------------+
| Options | - `groups`_ |
| | - `schemes`_ |
| | - `message`_ |
| | - `payload`_ |
+----------------+--------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\CardScheme` |
+----------------+--------------------------------------------------------------------------+
| Validator | :class:`Symfony\\Component\\Validator\\Constraints\\CardSchemeValidator` |
+----------------+--------------------------------------------------------------------------+
========== ===================================================================
Applies to :ref:`property or method <validation-property-target>`
Options - `groups`_
- `message`_
- `payload`_
- `schemes`_
Class :class:`Symfony\\Component\\Validator\\Constraints\\CardScheme`
Validator :class:`Symfony\\Component\\Validator\\Constraints\\CardSchemeValidator`
========== ===================================================================

Basic Usage
-----------
Expand Down Expand Up @@ -104,6 +101,23 @@ Available Options

.. include:: /reference/constraints/_groups-option.rst.inc

message
~~~~~~~

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

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

You can use the following parameters in this message:

=============== ==============================================================
Parameter Description
=============== ==============================================================
``{{ value }}`` The current (invalid) value
=============== ==============================================================

.. include:: /reference/constraints/_payload-option.rst.inc

schemes
~~~~~~~

Expand Down Expand Up @@ -132,21 +146,4 @@ Valid values are:
For more information about the used schemes, see
`Wikipedia: Issuer identification number (IIN)`_.

message
~~~~~~~

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

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`Wikipedia: Issuer identification number (IIN)`: https://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29
Loading
0