Skip to content

Commit 4475d7c

Browse files
committed
Merge remote-tracking branch 'upstream/2.7' into 2.7
2 parents 147e546 + 1915270 commit 4475d7c

File tree

21 files changed

+288
-172
lines changed

21 files changed

+288
-172
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ in the console, so it is a good practice to put some useful information in it. T
142142
function should also return the value of the user's input if the validation was successful.
143143

144144
You can set the max number of times to ask in the ``$attempts`` argument.
145-
If you reach this max number it will use the default value.
146145
Using ``false`` means the amount of attempts is infinite.
147146
The user will be asked as long as they provide an invalid answer and will only
148147
be able to proceed if their input is valid.
149148

149+
Each time the user is asked the question, the default one is used if no answer
150+
is supplied (and validated with the ``$validator`` callback). If the last
151+
attempt is reached, the application will throw an exception and ends its
152+
execution.
153+
150154
Validating a Hidden Response
151155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152156

components/validator.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ characters long::
4646
}
4747
}
4848

49+
The validator returns the list of violations.
50+
4951
Retrieving a Validator Instance
5052
-------------------------------
5153

contributing/code/standards.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ Service Naming Conventions
225225
Documentation
226226
-------------
227227

228-
* Add PHPDoc blocks for all classes, methods, and functions;
228+
* Add PHPDoc blocks for all classes, methods, and functions (though you may
229+
be asked to remove PHPDoc that do not add value);
229230

230231
* Group annotations together so that annotations of the same type immediately
231232
follow each other, and annotations of a different type are separated by a

controller/service.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,19 @@ These are the main **advantages** of defining controllers as services:
2323
service container configuration. This is useful when developing reusable bundles;
2424
* Your controllers are more "sandboxed". By looking at the constructor arguments,
2525
it's easy to see what types of things this controller may or may not do;
26+
* If you're not passing some required dependencies or if you are injecting some
27+
non-existent services, you'll get errors during the container compilation
28+
instead of during runtime execution;
2629
* Since dependencies must be injected manually, it's more obvious when your
2730
controller is becoming too big (i.e. if you have many constructor arguments).
2831

2932
These are the main **drawbacks** of defining controllers as services:
3033

31-
* It takes more work to create the controllers because they don't have
32-
automatic access to the services or to the base controller shortcuts;
34+
* It takes more work to create the controllers and they become more verbose
35+
because they don't have automatic access to the services and the base
36+
controller shortcuts;
3337
* The constructor of the controllers can rapidly become too complex because you
34-
must inject every single dependency needed by them;
35-
* The code of the controllers is more verbose because you can't use the shortcuts
36-
of the base controller and you must replace them with some lines of code.
38+
must inject every single dependency needed by them.
3739

3840
The recommendation from the :doc:`best practices </best_practices/controllers>`
3941
is also valid for controllers defined as services: avoid putting your business

forms.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,10 @@ the correct values of a number of field options.
568568
field ``nullable``). This is very useful, as your client-side validation will
569569
automatically match your validation rules.
570570

571-
``max_length``
572-
If the field is some sort of text field, then the ``max_length`` option can be
573-
guessed from the validation constraints (if ``Length`` or ``Range`` is used) or
574-
from the Doctrine metadata (via the field's length).
571+
``maxlength``
572+
If the field is some sort of text field, then the ``maxlength`` option attribute
573+
can be guessed from the validation constraints (if ``Length`` or ``Range`` is used)
574+
or from the Doctrine metadata (via the field's length).
575575

576576
.. caution::
577577

page_creation.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,7 @@ random) number and prints it. To do that, create a "Controller class" and a
6363
Before diving into this, test it out! If you are using PHP's internal web server
6464
go to:
6565

66-
http://localhost:8000/app_dev.php/lucky/number
67-
68-
.. tip::
69-
70-
If you're using the built-in PHP web-server, you can omit the ``app_dev.php``
71-
part of the URL.
66+
http://localhost:8000/lucky/number
7267

7368
If you see a lucky number being printed back to you, congratulations! But before
7469
you run off to play the lottery, check out how this works. Remember the two steps

reference/configuration/security.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,14 @@ use_referer
348348
**type**: ``boolean`` **default**: ``false``
349349

350350
If ``true``, the user is redirected to the value stored in the ``HTTP_REFERER``
351-
header when no previous URL was stored in the session.
351+
header when no previous URL was stored in the session. If the referrer URL is
352+
the same as the one generated with the ``login_path`` route, the user is
353+
redirected to the ``default_target_path`` to avoid a redirection loop.
354+
355+
.. note::
356+
357+
For historical reasons, and to match the misspelling of the HTTP standard,
358+
the option is called ``use_referer`` instead of ``use_referrer``.
352359

353360
.. _reference-security-pbkdf2:
354361

reference/constraints/Blank.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
Blank
22
=====
33

4-
Validates that a value is blank, defined as equal to a blank string or equal
5-
to ``null``. To force that a value strictly be equal to ``null``, see the
6-
:doc:`/reference/constraints/IsNull` constraint. To force that a value is
7-
*not* blank, see :doc:`/reference/constraints/NotBlank`.
4+
Validates that a value is blank - meaning equal to an empty string or ``null``::
5+
6+
if ('' !== $value && null !== $value) {
7+
// validation will fail
8+
}
9+
10+
To force that a value strictly be equal to ``null``, see the
11+
:doc:`/reference/constraints/IsNull` constraint.
12+
13+
14+
To force that a value is *not* blank, see :doc:`/reference/constraints/NotBlank`.
15+
But be careful as ``NotBlank`` is *not* strictly the opposite of ``Blank``.
816

917
+----------------+---------------------------------------------------------------------+
1018
| Applies to | :ref:`property or method <validation-property-target>` |

reference/constraints/NotBlank.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
NotBlank
22
========
33

4-
Validates that a value is not blank, defined as not strictly ``false``,
5-
not equal to a blank string and also not equal to ``null``. To force that
6-
a value is simply not equal to ``null``, see the
4+
Validates that a value is not blank - meaning not equal to a blank string,
5+
a blank array or ``null``::
6+
7+
if (false === $value || (empty($value) && '0' != $value)) {
8+
// validation will fail
9+
}
10+
11+
To force that a value is simply not equal to ``null``, see the
712
:doc:`/reference/constraints/NotNull` constraint.
813

914
+----------------+------------------------------------------------------------------------+

reference/dic_tags.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,10 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface`.
10001000

10011001
For more details, see :doc:`/serializer`.
10021002

1003+
The priorities of the default normalizers can be found in the
1004+
:method:`Symfony\\Bundle\\FrameworkBundle\\DependencyInjection\\FrameworkExtension::registerSerializerConfiguration`
1005+
method.
1006+
10031007
swiftmailer.default.plugin
10041008
--------------------------
10051009

0 commit comments

Comments
 (0)