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

Diff for: best_practices/forms.rst

+7-1
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();

Diff for: book/controller.rst

+4-17
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
--------------

Diff for: book/routing.rst

-3
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

Diff for: book/security.rst

-16
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``.

Diff for: book/service_container.rst

-3
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

Diff for: book/templating.rst

-6
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

Diff for: book/testing.rst

-3
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

Diff for: book/translation.rst

-6
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

Diff for: book/validation.rst

+4-4
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>

Diff for: components/config/definition.rst

-4
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

Diff for: components/console/events.rst

-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ dispatched. Listeners receive a
5959
Disable Commands inside Listeners
6060
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6161

62-
.. versionadded:: 2.6
63-
Disabling commands inside listeners was introduced in Symfony 2.6.
64-
6562
Using the
6663
:method:`Symfony\\Component\\Console\\Event\\ConsoleCommandEvent::disableCommand`
6764
method, you can disable a command inside a listener. The application

Diff for: components/console/helpers/debug_formatter.rst

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
Debug Formatter Helper
55
======================
66

7-
.. versionadded:: 2.6
8-
The Debug Formatter helper was introduced in Symfony 2.6.
9-
107
The :class:`Symfony\\Component\\Console\\Helper\\DebugFormatterHelper` provides
118
functions to output debug information when running an external program, for
129
instance a process or HTTP request. For example, if you used it to output

Diff for: components/console/helpers/processhelper.rst

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
Process Helper
55
==============
66

7-
.. versionadded:: 2.6
8-
The Process Helper was introduced in Symfony 2.6.
9-
107
The Process Helper shows processes as they're running and reports
118
useful information about process status.
129

Diff for: components/console/helpers/progressbar.rst

-14
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ Instead of advancing the bar by a number of steps (with the
4040
you can also set the current progress by calling the
4141
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method.
4242

43-
.. versionadded:: 2.6
44-
The ``setProgress()`` method was called ``setCurrent()`` prior to Symfony 2.6.
45-
46-
.. caution::
47-
48-
Prior to version 2.6, the progress bar only works if your platform
49-
supports ANSI codes; on other platforms, no output is generated.
50-
5143
.. tip::
5244

5345
If your platform doesn't support ANSI codes, updates to the progress
@@ -57,9 +49,6 @@ you can also set the current progress by calling the
5749
accordingly. By default, when using a ``max``, the redraw frequency
5850
is set to *10%* of your ``max``.
5951

60-
.. versionadded:: 2.6
61-
The ``setRedrawFrequency()`` method was introduced in Symfony 2.6.
62-
6352
If you don't know the number of steps in advance, just omit the steps argument
6453
when creating the :class:`Symfony\\Component\\Console\\Helper\\ProgressBar`
6554
instance::
@@ -307,9 +296,6 @@ that displays the number of remaining steps::
307296
}
308297
);
309298

310-
.. versionadded:: 2.6
311-
The ``getProgress()`` method was called ``getStep()`` prior to Symfony 2.6.
312-
313299
Custom Messages
314300
~~~~~~~~~~~~~~~
315301

Diff for: components/dependency_injection/factories.rst

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ For this situation, you can use a factory to create the object and tell
1212
the service container to call a method on the factory rather than directly
1313
instantiating the class.
1414

15-
.. versionadded:: 2.6
16-
The new :method:`Symfony\\Component\\DependencyInjection\\Definition::setFactory`
17-
method was introduced in Symfony 2.6. Refer to older versions for the
18-
syntax for factories prior to 2.6.
19-
2015
Suppose you have a factory that configures and returns a new ``NewsletterManager``
2116
object::
2217

Diff for: components/dom_crawler.rst

-4
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,6 @@ Get all the child or parent nodes::
190190
Accessing Node Values
191191
~~~~~~~~~~~~~~~~~~~~~
192192

193-
.. versionadded:: 2.6
194-
The :method:`Symfony\\Component\\DomCrawler\\Crawler::nodeName`
195-
method was introduced in Symfony 2.6.
196-
197193
Access the node name (HTML tag name) of the first node of the current selection (eg. "p" or "div")::
198194

199195
// will return the node name (HTML tag name) of the first child element under <body>

Diff for: components/event_dispatcher/introduction.rst

-4
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,6 @@ and so on...
628628
Event Name Introspection
629629
~~~~~~~~~~~~~~~~~~~~~~~~
630630

631-
.. versionadded:: 2.4
632-
Before Symfony 2.4, the event name and the event dispatcher had to be
633-
requested from the ``Event`` instance. These methods are now deprecated.
634-
635631
The ``EventDispatcher`` instance, as well as the name of the event that
636632
is dispatched, are passed as arguments to the listener::
637633

Diff for: components/expression_language/extending.rst

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ evaluating or the "names" if compiling).
5656
Using Expression Providers
5757
--------------------------
5858

59-
.. versionadded:: 2.6
60-
Expression providers were introduced in Symfony 2.6.
61-
6259
When you use the ``ExpressionLanguage`` class in your library, you often want
6360
to add custom functions. To do so, you can create a new expression provider by
6461
creating a class that implements

Diff for: components/filesystem/lock_handler.rst

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
LockHandler
22
===========
33

4-
.. versionadded:: 2.6
5-
The lock handler feature was introduced in Symfony 2.6
6-
74
What is a Lock?
85
---------------
96

Diff for: components/http_foundation/introduction.rst

-3
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,6 @@ You can still set the ``Content-Type`` of the sent file, or change its ``Content
512512
'filename.txt'
513513
);
514514

515-
.. versionadded:: 2.6
516-
The ``deleteFileAfterSend()`` method was introduced in Symfony 2.6.
517-
518515
It is possible to delete the file after the request is sent with the
519516
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method.
520517
Please note that this will not work when the ``X-Sendfile`` header is set.

0 commit comments

Comments
 (0)