Skip to content

Commit 64f8a1e

Browse files
committed
Merge branch '2.8' into 3.0
2 parents ae53c89 + ddd3478 commit 64f8a1e

Some content is hidden

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

69 files changed

+487
-403
lines changed

best_practices/forms.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,17 @@ form in its own PHP class::
4747
}
4848
}
4949

50+
.. best-practice::
51+
52+
Put the form type classes in the ``AppBundle\Form`` namespace, unless you
53+
use other custom form classes like data transformers.
54+
5055
To use the class, use ``createForm`` and pass the fully qualified class name::
5156

52-
use AppBundle\Form\PostType;
5357
// ...
58+
use AppBundle\Form\PostType;
5459

60+
// ...
5561
public function newAction(Request $request)
5662
{
5763
$post = new Post();

book/controller.rst

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,6 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
441441
// return $this->redirect($this->generateUrl('homepage'), 301);
442442
}
443443

444-
.. versionadded:: 2.6
445-
The ``redirectToRoute()`` method was introduced in Symfony 2.6. Previously (and still now), you
446-
could use ``redirect()`` and ``generateUrl()`` together for this (see the example above).
447-
448444
Or, if you want to redirect externally, just use ``redirect()`` and pass it the URL::
449445

450446
public function indexAction()
@@ -536,9 +532,6 @@ console command:
536532
537533
$ php bin/console debug:container
538534
539-
.. versionadded:: 2.6
540-
Prior to Symfony 2.6, this command was called ``container:debug``.
541-
542535
For more information, see the :doc:`/book/service_container` chapter.
543536

544537
.. index::
@@ -825,16 +818,10 @@ method to check the CSRF token::
825818
// ... do something, like deleting an object
826819
}
827820

828-
.. versionadded:: 2.6
829-
The ``isCsrfTokenValid()`` shortcut method was introduced in Symfony 2.6.
830-
It is equivalent to executing the following code:
831-
832-
.. code-block:: php
833-
834-
use Symfony\Component\Security\Csrf\CsrfToken;
835-
836-
$this->get('security.csrf.token_manager')
837-
->isTokenValid(new CsrfToken('token_id', 'TOKEN'));
821+
// isCsrfTokenValid() is equivalent to:
822+
// $this->get('security.csrf.token_manager')->isTokenValid()
823+
// new \Symfony\Component\Security\Csrf\CsrfToken\CsrfToken('token_id', $token)
824+
// );
838825

839826
Final Thoughts
840827
--------------

book/routing.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,6 @@ the command by running the following from the root of your project.
14031403
14041404
$ php bin/console debug:router
14051405
1406-
.. versionadded:: 2.6
1407-
Prior to Symfony 2.6, this command was called ``router:debug``.
1408-
14091406
This command will print a helpful list of *all* the configured routes in
14101407
your application:
14111408

book/security.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -844,15 +844,6 @@ You can easily deny access from inside a controller::
844844
// ...
845845
}
846846

847-
.. versionadded:: 2.6
848-
The ``denyAccessUnlessGranted()`` method was introduced in Symfony 2.6. Previously (and
849-
still now), you could check access directly and throw the ``AccessDeniedException`` as shown
850-
in the example above).
851-
852-
.. versionadded:: 2.6
853-
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
854-
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.
855-
856847
In both cases, a special
857848
:class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
858849
is thrown, which ultimately triggers a 403 HTTP response inside Symfony.
@@ -1017,10 +1008,6 @@ shown above.
10171008
Retrieving the User Object
10181009
--------------------------
10191010

1020-
.. versionadded:: 2.6
1021-
The ``security.token_storage`` service was introduced in Symfony 2.6. Prior
1022-
to Symfony 2.6, you had to use the ``getToken()`` method of the ``security.context`` service.
1023-
10241011
After authentication, the ``User`` object of the current user can be accessed
10251012
via the ``security.token_storage`` service. From inside a controller, this will
10261013
look like::
@@ -1221,9 +1208,6 @@ in the following way from a controller::
12211208

12221209
$user->setPassword($encoded);
12231210

1224-
.. versionadded:: 2.6
1225-
The ``security.password_encoder`` service was introduced in Symfony 2.6.
1226-
12271211
In order for this to work, just make sure that you have the encoder for your
12281212
user class (e.g. ``AppBundle\Entity\User``) configured under the ``encoders``
12291213
key in ``app/config/security.yml``.

book/service_container.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,6 @@ console. To show all services and the class for each service, run:
11361136
11371137
$ php bin/console debug:container
11381138
1139-
.. versionadded:: 2.6
1140-
Prior to Symfony 2.6, this command was called ``container:debug``.
1141-
11421139
By default, only public services are shown, but you can also view private services:
11431140

11441141
.. code-block:: bash

book/templating.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,12 +1269,6 @@ automatically:
12691269
<p>Application Environment: <?php echo $app->getEnvironment() ?></p>
12701270
<?php endif ?>
12711271

1272-
.. versionadded:: 2.6
1273-
The global ``app.security`` variable (or the ``$app->getSecurity()``
1274-
method in PHP templates) is deprecated as of Symfony 2.6. Use ``app.user``
1275-
(``$app->getUser()``) and ``is_granted()`` (``$view['security']->isGranted()``)
1276-
instead.
1277-
12781272
.. tip::
12791273

12801274
You can add your own global template variables. See the cookbook example

book/testing.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,6 @@ Be warned that this does not work if you insulate the client or if you use an
470470
HTTP layer. For a list of services available in your application, use the
471471
``debug:container`` console task.
472472

473-
.. versionadded:: 2.6
474-
Prior to Symfony 2.6, this command was called ``container:debug``.
475-
476473
.. tip::
477474

478475
If the information you need to check is available from the profiler, use

book/translation.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,9 +452,6 @@ checks translation resources for several locales:
452452
#. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration
453453
parameter, which defaults to ``en`` (see `Configuration`_).
454454

455-
.. versionadded:: 2.6
456-
The ability to log missing translations was introduced in Symfony 2.6.
457-
458455
.. note::
459456

460457
When Symfony doesn't find a translation in the given locale, it will
@@ -746,9 +743,6 @@ For more information, see the documentation for these libraries.
746743
Debugging Translations
747744
----------------------
748745

749-
.. versionadded:: 2.6
750-
Prior to Symfony 2.6, this command was called ``translation:debug``.
751-
752746
When maintaining a bundle, you may use or remove the usage of a translation
753747
message without updating all message catalogues. The ``debug:translation``
754748
command helps you to find these missing or unused translation messages for a

book/validation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ this method must return ``true``:
644644
AppBundle\Entity\Author:
645645
getters:
646646
passwordLegal:
647-
- 'True': { message: 'The password cannot match your first name' }
647+
- 'IsTrue': { message: 'The password cannot match your first name' }
648648
649649
.. code-block:: xml
650650
@@ -656,7 +656,7 @@ this method must return ``true``:
656656
657657
<class name="AppBundle\Entity\Author">
658658
<getter property="passwordLegal">
659-
<constraint name="True">
659+
<constraint name="IsTrue">
660660
<option name="message">The password cannot match your first name</option>
661661
</constraint>
662662
</getter>
@@ -954,7 +954,7 @@ username and the password are different only if all other validation passes
954954
- Strict
955955
getters:
956956
passwordLegal:
957-
- 'True':
957+
- 'IsTrue':
958958
message: 'The password cannot match your username'
959959
groups: [Strict]
960960
properties:
@@ -981,7 +981,7 @@ username and the password are different only if all other validation passes
981981
</property>
982982
983983
<getter property="passwordLegal">
984-
<constraint name="True">
984+
<constraint name="IsTrue">
985985
<option name="message">The password cannot match your username</option>
986986
<option name="groups">
987987
<value>Strict</value>

components/config/definition.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,6 @@ method.
421421
The info will be printed as a comment when dumping the configuration tree
422422
with the ``config:dump-reference`` command.
423423

424-
.. versionadded:: 2.6
425-
Since Symfony 2.6, the info will also be added to the exception message
426-
when an invalid type is given.
427-
428424
Optional Sections
429425
-----------------
430426

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy