Skip to content

Commit

Permalink
Merge branch '2.8' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Dec 31, 2015
2 parents ae53c89 + ddd3478 commit 64f8a1e
Show file tree
Hide file tree
Showing 69 changed files with 487 additions and 403 deletions.
8 changes: 7 additions & 1 deletion best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ form in its own PHP class::
}
}

.. best-practice::

Put the form type classes in the ``AppBundle\Form`` namespace, unless you
use other custom form classes like data transformers.

To use the class, use ``createForm`` and pass the fully qualified class name::

use AppBundle\Form\PostType;
// ...
use AppBundle\Form\PostType;

// ...
public function newAction(Request $request)
{
$post = new Post();
Expand Down
21 changes: 4 additions & 17 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,6 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
// return $this->redirect($this->generateUrl('homepage'), 301);
}

.. versionadded:: 2.6
The ``redirectToRoute()`` method was introduced in Symfony 2.6. Previously (and still now), you
could use ``redirect()`` and ``generateUrl()`` together for this (see the example above).

Or, if you want to redirect externally, just use ``redirect()`` and pass it the URL::

public function indexAction()
Expand Down Expand Up @@ -536,9 +532,6 @@ console command:
$ php bin/console debug:container
.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

For more information, see the :doc:`/book/service_container` chapter.

.. index::
Expand Down Expand Up @@ -825,16 +818,10 @@ method to check the CSRF token::
// ... do something, like deleting an object
}

.. versionadded:: 2.6
The ``isCsrfTokenValid()`` shortcut method was introduced in Symfony 2.6.
It is equivalent to executing the following code:

.. code-block:: php
use Symfony\Component\Security\Csrf\CsrfToken;
$this->get('security.csrf.token_manager')
->isTokenValid(new CsrfToken('token_id', 'TOKEN'));
// isCsrfTokenValid() is equivalent to:
// $this->get('security.csrf.token_manager')->isTokenValid()
// new \Symfony\Component\Security\Csrf\CsrfToken\CsrfToken('token_id', $token)
// );

Final Thoughts
--------------
Expand Down
3 changes: 0 additions & 3 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1403,9 +1403,6 @@ the command by running the following from the root of your project.
$ php bin/console debug:router
.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``router:debug``.

This command will print a helpful list of *all* the configured routes in
your application:

Expand Down
16 changes: 0 additions & 16 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -844,15 +844,6 @@ You can easily deny access from inside a controller::
// ...
}

.. versionadded:: 2.6
The ``denyAccessUnlessGranted()`` method was introduced in Symfony 2.6. Previously (and
still now), you could check access directly and throw the ``AccessDeniedException`` as shown
in the example above).

.. versionadded:: 2.6
The ``security.authorization_checker`` service was introduced in Symfony 2.6. Prior
to Symfony 2.6, you had to use the ``isGranted()`` method of the ``security.context`` service.

In both cases, a special
:class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException`
is thrown, which ultimately triggers a 403 HTTP response inside Symfony.
Expand Down Expand Up @@ -1017,10 +1008,6 @@ shown above.
Retrieving the User Object
--------------------------

.. versionadded:: 2.6
The ``security.token_storage`` service was introduced in Symfony 2.6. Prior
to Symfony 2.6, you had to use the ``getToken()`` method of the ``security.context`` service.

After authentication, the ``User`` object of the current user can be accessed
via the ``security.token_storage`` service. From inside a controller, this will
look like::
Expand Down Expand Up @@ -1221,9 +1208,6 @@ in the following way from a controller::

$user->setPassword($encoded);

.. versionadded:: 2.6
The ``security.password_encoder`` service was introduced in Symfony 2.6.

In order for this to work, just make sure that you have the encoder for your
user class (e.g. ``AppBundle\Entity\User``) configured under the ``encoders``
key in ``app/config/security.yml``.
Expand Down
3 changes: 0 additions & 3 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,6 @@ console. To show all services and the class for each service, run:
$ php bin/console debug:container
.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

By default, only public services are shown, but you can also view private services:

.. code-block:: bash
Expand Down
6 changes: 0 additions & 6 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1269,12 +1269,6 @@ automatically:
<p>Application Environment: <?php echo $app->getEnvironment() ?></p>
<?php endif ?>

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

.. tip::

You can add your own global template variables. See the cookbook example
Expand Down
3 changes: 0 additions & 3 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,6 @@ Be warned that this does not work if you insulate the client or if you use an
HTTP layer. For a list of services available in your application, use the
``debug:container`` console task.

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

.. tip::

If the information you need to check is available from the profiler, use
Expand Down
6 changes: 0 additions & 6 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,6 @@ checks translation resources for several locales:
#. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration
parameter, which defaults to ``en`` (see `Configuration`_).

.. versionadded:: 2.6
The ability to log missing translations was introduced in Symfony 2.6.

.. note::

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

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``translation:debug``.

When maintaining a bundle, you may use or remove the usage of a translation
message without updating all message catalogues. The ``debug:translation``
command helps you to find these missing or unused translation messages for a
Expand Down
8 changes: 4 additions & 4 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ this method must return ``true``:
AppBundle\Entity\Author:
getters:
passwordLegal:
- 'True': { message: 'The password cannot match your first name' }
- 'IsTrue': { message: 'The password cannot match your first name' }
.. code-block:: xml
Expand All @@ -656,7 +656,7 @@ this method must return ``true``:
<class name="AppBundle\Entity\Author">
<getter property="passwordLegal">
<constraint name="True">
<constraint name="IsTrue">
<option name="message">The password cannot match your first name</option>
</constraint>
</getter>
Expand Down Expand Up @@ -954,7 +954,7 @@ username and the password are different only if all other validation passes
- Strict
getters:
passwordLegal:
- 'True':
- 'IsTrue':
message: 'The password cannot match your username'
groups: [Strict]
properties:
Expand All @@ -981,7 +981,7 @@ username and the password are different only if all other validation passes
</property>
<getter property="passwordLegal">
<constraint name="True">
<constraint name="IsTrue">
<option name="message">The password cannot match your username</option>
<option name="groups">
<value>Strict</value>
Expand Down
4 changes: 0 additions & 4 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,6 @@ method.
The info will be printed as a comment when dumping the configuration tree
with the ``config:dump-reference`` command.

.. versionadded:: 2.6
Since Symfony 2.6, the info will also be added to the exception message
when an invalid type is given.

Optional Sections
-----------------

Expand Down
3 changes: 0 additions & 3 deletions components/console/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ dispatched. Listeners receive a
Disable Commands inside Listeners
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.6
Disabling commands inside listeners was introduced in Symfony 2.6.

Using the
:method:`Symfony\\Component\\Console\\Event\\ConsoleCommandEvent::disableCommand`
method, you can disable a command inside a listener. The application
Expand Down
3 changes: 0 additions & 3 deletions components/console/helpers/debug_formatter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Debug Formatter Helper
======================

.. versionadded:: 2.6
The Debug Formatter helper was introduced in Symfony 2.6.

The :class:`Symfony\\Component\\Console\\Helper\\DebugFormatterHelper` provides
functions to output debug information when running an external program, for
instance a process or HTTP request. For example, if you used it to output
Expand Down
3 changes: 0 additions & 3 deletions components/console/helpers/processhelper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Process Helper
==============

.. versionadded:: 2.6
The Process Helper was introduced in Symfony 2.6.

The Process Helper shows processes as they're running and reports
useful information about process status.

Expand Down
14 changes: 0 additions & 14 deletions components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ Instead of advancing the bar by a number of steps (with the
you can also set the current progress by calling the
:method:`Symfony\\Component\\Console\\Helper\\ProgressBar::setProgress` method.

.. versionadded:: 2.6
The ``setProgress()`` method was called ``setCurrent()`` prior to Symfony 2.6.

.. caution::

Prior to version 2.6, the progress bar only works if your platform
supports ANSI codes; on other platforms, no output is generated.

.. tip::

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

.. versionadded:: 2.6
The ``setRedrawFrequency()`` method was introduced in Symfony 2.6.

If you don't know the number of steps in advance, just omit the steps argument
when creating the :class:`Symfony\\Component\\Console\\Helper\\ProgressBar`
instance::
Expand Down Expand Up @@ -307,9 +296,6 @@ that displays the number of remaining steps::
}
);

.. versionadded:: 2.6
The ``getProgress()`` method was called ``getStep()`` prior to Symfony 2.6.

Custom Messages
~~~~~~~~~~~~~~~

Expand Down
5 changes: 0 additions & 5 deletions components/dependency_injection/factories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ For this situation, you can use a factory to create the object and tell
the service container to call a method on the factory rather than directly
instantiating the class.

.. versionadded:: 2.6
The new :method:`Symfony\\Component\\DependencyInjection\\Definition::setFactory`
method was introduced in Symfony 2.6. Refer to older versions for the
syntax for factories prior to 2.6.

Suppose you have a factory that configures and returns a new ``NewsletterManager``
object::

Expand Down
4 changes: 0 additions & 4 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ Get all the child or parent nodes::
Accessing Node Values
~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.6
The :method:`Symfony\\Component\\DomCrawler\\Crawler::nodeName`
method was introduced in Symfony 2.6.

Access the node name (HTML tag name) of the first node of the current selection (eg. "p" or "div")::

// will return the node name (HTML tag name) of the first child element under <body>
Expand Down
4 changes: 0 additions & 4 deletions components/event_dispatcher/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,6 @@ and so on...
Event Name Introspection
~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.4
Before Symfony 2.4, the event name and the event dispatcher had to be
requested from the ``Event`` instance. These methods are now deprecated.

The ``EventDispatcher`` instance, as well as the name of the event that
is dispatched, are passed as arguments to the listener::

Expand Down
3 changes: 0 additions & 3 deletions components/expression_language/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ evaluating or the "names" if compiling).
Using Expression Providers
--------------------------

.. versionadded:: 2.6
Expression providers were introduced in Symfony 2.6.

When you use the ``ExpressionLanguage`` class in your library, you often want
to add custom functions. To do so, you can create a new expression provider by
creating a class that implements
Expand Down
3 changes: 0 additions & 3 deletions components/filesystem/lock_handler.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
LockHandler
===========

.. versionadded:: 2.6
The lock handler feature was introduced in Symfony 2.6

What is a Lock?
---------------

Expand Down
3 changes: 0 additions & 3 deletions components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,6 @@ You can still set the ``Content-Type`` of the sent file, or change its ``Content
'filename.txt'
);

.. versionadded:: 2.6
The ``deleteFileAfterSend()`` method was introduced in Symfony 2.6.

It is possible to delete the file after the request is sent with the
:method:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse::deleteFileAfterSend` method.
Please note that this will not work when the ``X-Sendfile`` header is set.
Expand Down
Loading

0 comments on commit 64f8a1e

Please sign in to comment.