8000 Merge branch '2.7' into 2.8 · symfony/symfony-docs@bab1a69 · GitHub
[go: up one dir, main page]

Skip to content

Commit bab1a69

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Reworded the article about form login redirects Explained the edge-case where the use_referer option doesn't work [#7572] fix wording [#7585] remove trailing whitespaces [#7585] minor rewording Fixed a typo Fixed a typo Update parent_services for tip consistency [#7685] use the method role Minor change Updating doc to specify priority of default normalizer [#7767] remove trailing space Minor reword Moved array validation to the Raw values sub-guide Fixed some syntax issues missing constraint example from the old readme Update console dialog helper documentation Improved the advantages/drawbacks of "controllers as services"
2 parents df78588 + bd74006 commit bab1a69

File tree

8 files changed

+212
-102
lines changed

8 files changed

+212
-102
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

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

reference/configuration/security.rst

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

428428
If ``true``, the user is redirected to the value stored in the ``HTTP_REFERER``
429-
header when no previous URL was stored in the session.
429+
header when no previous URL was stored in the session. If the referrer URL is
430+
the same as the one generated with the ``login_path`` route, the user is
431+
redirected to the ``default_target_path`` to avoid a redirection loop.
432+
433+
.. note::
434+
435+
For historical reasons, and to match the misspelling of the HTTP standard,
436+
the option is called ``use_referer`` instead of ``use_referrer``.
430437

431438
.. _reference-security-pbkdf2:
432439

reference/dic_tags.rst

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

993993
For more details, see :doc:`/serializer`.
994994

995+
The priorities of the default normalizers can be found in the
996+
:method:`Symfony\\Bundle\\FrameworkBundle\\DependencyInjection\\FrameworkExtension::registerSerializerConfiguration`
997+
method.
998+
995999
swiftmailer.default.plugin
9961000
--------------------------
9971001

0 commit comments

Comments
 (0)
0