Skip to content

Commit 1ccaced

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: Add information about resolver argument priority Removed a paragrpah in favor of the table of data [PHPUnit Bridge] Fix text and table inconsistency Update forms.rst
2 parents a9b761a + eb6a274 commit 1ccaced

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

components/phpunit_bridge.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,6 @@ its ``bin/simple-phpunit`` command. It has the following features:
836836

837837
* Works with a standalone vendor directory that doesn't conflict with yours;
838838
* Does not embed ``prophecy`` to prevent any conflicts with its dependencies;
839-
* Uses PHPUnit 4.8 when run with PHP <=5.5, PHPUnit 5.7 when run with PHP >=5.6
840-
and PHPUnit 6.5 when run with PHP >=7.2;
841839
* Collects and replays skipped tests when the ``SYMFONY_PHPUNIT_SKIPPED_TESTS``
842840
env var is defined: the env var should specify a file name that will be used for
843841
storing skipped tests on a first run, and replay them on the second run;

controller/argument_value_resolver.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ and adding a priority.
233233
;
234234
235235
While adding a priority is optional, it's recommended to add one to make sure
236-
the expected value is injected. The ``RequestAttributeValueResolver`` has a
237-
priority of 100. As this one is responsible for fetching attributes from the
238-
``Request``, it's recommended to trigger your custom value resolver with a
239-
lower priority. This makes sure the argument resolvers are not triggered when
240-
the attribute is present. For instance, when passing the user along a
241-
sub-requests.
236+
the expected value is injected. The built-in ``RequestAttributeValueResolver``,
237+
which fetches attributes from the ``Request``, has a priority of ``100``. If your
238+
resolver also fetches ``Request`` attributes, set a priority of ``100`` or more.
239+
Otherwise, set a priority lower than ``100`` to make sure the argument resolver
240+
is not triggered when the ``Request`` attribute is present (for example, when
241+
passing the user along sub-requests).
242242

243243
.. tip::
244244

forms.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,12 @@ Before using validation, add support for it in your application:
459459
460460
$ composer require symfony/validator
461461
462-
Validation is done by adding a set of rules (called constraints) to a class. To
463-
see this in action, add validation constraints so that the ``task`` field cannot
464-
be empty and the ``dueDate`` field cannot be empty and must be a valid \DateTime
462+
Validation is done by adding a set of rules, called (validation) constraints,
463+
to a class. You can add them either to the entity class or to the form class.
464+
465+
To see the first approach - adding constraints to the entity - in action,
466+
add the validation constraints, so that the ``task`` field cannot be empty,
467+
and the ``dueDate`` field cannot be empty, and must be a valid ``DateTime``
465468
object.
466469

467470
.. configuration-block::
@@ -544,9 +547,11 @@ object.
544547
}
545548
546549
That's it! If you re-submit the form with invalid data, you'll see the
547-
corresponding errors printed out with the form. Read the
548-
:doc:`Symfony validation documentation </validation>` to learn more about this
549-
powerful feature.
550+
corresponding errors printed out with the form.
551+
552+
To see the second approach - adding constraints to the form - and to
553+
learn more about the validation constraints, please refer to the
554+
:doc:`Symfony validation documentation </validation>`.
550555

551556
Other Common Form Features
552557
--------------------------

0 commit comments

Comments
 (0)