Skip to content

Commit 2e73849

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Added the docs for the \"groups\" constraint option fixed paragraph about which versionadded directives will be removed
2 parents 31b9bae + 56e73bb commit 2e73849

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+197
-54
lines changed

contributing/community/review-comments.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ Don't use hyperbole ("always", "never", "endlessly", "nothing", "worst", "horrib
9191
**Don't:** *"I don't like how you wrote this code"* - there is no clear explanation why you
9292
don't like how it's written.
9393

94-
**Better:** *"I find it hard to read this code as there is many nested if statements, can you make it more
95-
readable? By encapsulating some of its details or maybe adding some comments to explain the overall logic."* -
94+
**Better:** *"I find it hard to read this code as there are many nested if statements, can you make it more
95+
readable? By encapsulating some of the details or maybe adding some comments to explain the overall logic."* -
9696
You explain why you find the code hard to read *and* give some suggestions for improvement.
9797

9898
If a piece of code is in fact wrong, explain why:
9999

100100
* "This code doesn't comply with Symfony's CS rules. Please see [...] for details."
101101

102-
* "Symfony 3 still uses PHP 5 and doesn't allow the usage scalar type-hints."
102+
* "Symfony 3 still uses PHP 5 and doesn't allow the usage of scalar type-hints."
103103

104104
* "I think the code is less readable now." - careful here, be sure explain why you think
105105
the code is less readable, and maybe give some suggestions?

contributing/documentation/format.rst

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,32 +173,30 @@ New Features or Behavior Changes
173173

174174
If you're documenting a brand new feature or a change that's been made in
175175
Symfony, you should precede your description of the change with a
176-
``.. versionadded:: 2.X`` directive and a short description:
176+
``.. versionadded:: 3.x`` directive and a short description:
177177

178178
.. code-block:: rst
179179
180-
.. versionadded:: 2.7
180+
.. versionadded:: 3.4
181181
182-
The ``askHiddenResponse()`` method was introduced in Symfony 2.7.
183-
184-
You can also ask a question and hide the response. This is particularly [...]
182+
The special ``!`` template prefix was introduced in Symfony 3.4.
185183
186184
If you're documenting a behavior change, it may be helpful to *briefly* describe
187185
how the behavior has changed:
188186

189187
.. code-block:: rst
190188
191-
.. versionadded:: 2.7
189+
.. versionadded:: 3.4
192190
193-
The ``include()`` function is a new Twig feature that's available in
194-
Symfony 2.7. Prior, the ``{% include %}`` tag was used.
191+
Support for annotation routing without an external bundle was added in
192+
Symfony 3.4. Prior, you needed to install the SensioFrameworkExtraBundle.
195193
196-
Whenever a new minor version of Symfony is released (e.g. 2.4, 2.5, etc),
194+
Whenever a new major version of Symfony is released (e.g. 3.0, 4.0, etc),
197195
a new branch of the documentation is created from the ``master`` branch.
198196
At this point, all the ``versionadded`` tags for Symfony versions that have
199-
reached end-of-maintenance will be removed. For example, if Symfony 2.5 were
200-
released today, and 2.2 had recently reached its end-of-maintenance, the 2.2
201-
``versionadded`` tags would be removed from the new ``2.5`` branch.
197+
a lower major version will be removed. For example, if Symfony 4.0 were
198+
released today, 3.0 to 3.4 ``versionadded`` tags would be removed from the new
199+
``4.0`` branch.
202200

203201
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
204202
.. _Sphinx: http://sphinx-doc.org/

reference/constraints/All.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ you to apply a collection of constraints to each element of the array.
88
| Applies to | :ref:`property or method <validation-property-target>` |
99
+----------------+-------------------------------------------------------------------+
1010
| Options | - `constraints`_ |
11+
| | - `groups`_ |
1112
| | - `payload`_ |
1213
+----------------+-------------------------------------------------------------------+
1314
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\All` |
@@ -109,4 +110,6 @@ constraints
109110
This required option is the array of validation constraints that you want
110111
to apply to each element of the underlying array.
111112

113+
.. include:: /reference/constraints/_groups-option.rst.inc
114+
112115
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/Bic.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ check that the BIC is associated with a given IBAN.
99
+----------------+-----------------------------------------------------------------------+
1010
| Applies to | :ref:`property or method <validation-property-target>` |
1111
+----------------+-----------------------------------------------------------------------+
12-
| Options | - `message`_ |
12+
| Options | - `groups`_ |
13+
| | - `message`_ |
1314
| | - `payload`_ |
1415
| | - `iban`_ |
1516
| | - `ibanMessage`_ |
@@ -89,6 +90,8 @@ will contain a Business Identifier Code (BIC).
8990
Available Options
9091
-----------------
9192

93+
.. include:: /reference/constraints/_groups-option.rst.inc
94+
9295
message
9396
~~~~~~~
9497

reference/constraints/Blank.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ But be careful as ``NotBlank`` is *not* strictly the opposite of ``Blank``.
1616
+----------------+---------------------------------------------------------------------+
1717
| Applies to | :ref:`property or method <validation-property-target>` |
1818
+----------------+---------------------------------------------------------------------+
19-
| Options | - `message`_ |
19+
| Options | - `groups`_ |
20+
| | - `message`_ |
2021
| | - `payload`_ |
2122
+----------------+---------------------------------------------------------------------+
2223
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Blank` |
@@ -89,6 +90,8 @@ of an ``Author`` class were blank, you could do the following:
8990
Options
9091
-------
9192

93+
.. include:: /reference/constraints/_groups-option.rst.inc
94+
9295
message
9396
~~~~~~~
9497

reference/constraints/Callback.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ can do anything, including creating and assigning validation errors.
2121
| Applies to | :ref:`class <validation-class-target>` |
2222
+----------------+------------------------------------------------------------------------+
2323
| Options | - :ref:`callback <callback-option>` |
24+
| | - `groups`_ |
2425
| | - `payload`_ |
2526
+----------------+------------------------------------------------------------------------+
2627
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Callback` |
@@ -275,4 +276,6 @@ Static or closure callbacks receive the validated object as the first argument
275276
and the :class:`Symfony\\Component\\Validator\\Context\\ExecutionContextInterface`
276277
instance as the second argument.
277278

279+
.. include:: /reference/constraints/_groups-option.rst.inc
280+
278281
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/CardScheme.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ a payment through a payment gateway.
88
+----------------+--------------------------------------------------------------------------+
99
| Applies to | :ref:`property or method <validation-property-target>` |
1010
+----------------+--------------------------------------------------------------------------+
11-
| Options | - `schemes`_ |
11+
| Options | - `groups`_ |
12+
| | - `schemes`_ |
1213
| | - `message`_ |
1314
| | - `payload`_ |
1415
+----------------+--------------------------------------------------------------------------+
@@ -101,6 +102,8 @@ on an object that will contain a credit card number.
101102
Available Options
102103
-----------------
103104

105+
.. include:: /reference/constraints/_groups-option.rst.inc
106+
104107
schemes
105108
~~~~~~~
106109

reference/constraints/Choice.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ an array of items is one of those valid choices.
1010
+----------------+----------------------------------------------------------------------+
1111
| Options | - `choices`_ |
1212
| | - `callback`_ |
13+
| | - `groups`_ |
1314
| | - `multiple`_ |
1415
| | - `min`_ |
1516
| | - `max`_ |
@@ -295,6 +296,8 @@ This is a callback method that can be used instead of the `choices`_ option
295296
to return the choices array. See
296297
`Supplying the Choices with a Callback Function`_ for details on its usage.
297298

299+
.. include:: /reference/constraints/_groups-option.rst.inc
300+
298301
multiple
299302
~~~~~~~~
300303

reference/constraints/Collection.rst

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ and that extra keys are not present.
1414
+----------------+--------------------------------------------------------------------------+
1515
| Applies to | :ref:`property or method <validation-property-target>` |
1616
+----------------+--------------------------------------------------------------------------+
17-
| Options | - `fields`_ |
18-
| | - `allowExtraFields`_ |
19-
| | - `extraFieldsMessage`_ |
17+
| Options | - `allowExtraFields`_ |
2018
| | - `allowMissingFields`_ |
19+
| | - `extraFieldsMessage`_ |
20+
| | - `fields`_ |
21+
| | - `groups`_ |
2122
| | - `missingFieldsMessage`_ |
2223
| | - `payload`_ |
2324
+----------------+--------------------------------------------------------------------------+
@@ -289,15 +290,6 @@ the ``NotBlank`` constraint will still be applied (since it is wrapped in
289290
Options
290291
-------
291292

292-
fields
293-
~~~~~~
294-
295-
**type**: ``array`` [:ref:`default option <validation-default-option>`]
296-
297-
This option is required and is an associative array defining all of the
298-
keys in the collection and, for each key, exactly which validator(s) should
299-
be executed against that element of the collection.
300-
301293
allowExtraFields
302294
~~~~~~~~~~~~~~~~
303295

@@ -307,6 +299,16 @@ If this option is set to ``false`` and the underlying collection contains
307299
one or more elements that are not included in the `fields`_ option, a validation
308300
error will be returned. If set to ``true``, extra fields are ok.
309301

302+
allowMissingFields
303+
~~~~~~~~~~~~~~~~~~
304+
305+
**type**: ``boolean`` **default**: false
306+
307+
If this option is set to ``false`` and one or more fields from the `fields`_
308+
option are not present in the underlying collection, a validation error
309+
will be returned. If set to ``true``, it's ok if some fields in the `fields`_
310+
option are not present in the underlying collection.
311+
310312
extraFieldsMessage
311313
~~~~~~~~~~~~~~~~~~
312314

@@ -323,15 +325,16 @@ You can use the following parameters in this message:
323325
| ``{{ field }}`` | The key of the extra field detected |
324326
+------------------+------------------------------------------------+
325327

326-
allowMissingFields
327-
~~~~~~~~~~~~~~~~~~
328+
fields
329+
~~~~~~
328330

329-
**type**: ``boolean`` **default**: false
331+
**type**: ``array`` [:ref:`default option <validation-default-option>`]
330332

331-
If this option is set to ``false`` and one or more fields from the `fields`_
332-
option are not present in the underlying collection, a validation error
333-
will be returned. If set to ``true``, it's ok if some fields in the `fields`_
334-
option are not present in the underlying collection.
333+
This option is required and is an associative array defining all of the
334+
keys in the collection and, for each key, exactly which validator(s) should
335+
be executed against that element of the collection.
336+
337+
.. include:: /reference/constraints/_groups-option.rst.inc
335338

336339
missingFieldsMessage
337340
~~~~~~~~~~~~~~~~~~~~

reference/constraints/Count.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Countable) element count is *between* some minimum and maximum value.
1313
| | - `maxMessage`_ |
1414
| | - `exactMessage`_ |
1515
| | - `payload`_ |
16+
| | - `groups`_ |
1617
+----------------+---------------------------------------------------------------------+
1718
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Count` |
1819
+----------------+---------------------------------------------------------------------+
@@ -103,6 +104,8 @@ you might add the following:
103104
Options
104105
-------
105106

107+
.. include:: /reference/constraints/_groups-option.rst.inc
108+
106109
min
107110
~~~
108111

0 commit comments

Comments
 (0)