Skip to content

Commit

Permalink
minor symfony#6242 Removed all 2.x versionadded directives (WouterJ)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.0 branch (closes symfony#6242).

Discussion
----------

Removed all 2.x versionadded directives

Replaces symfony#5585

Commits
-------

f8b560d Removed all 2.x versionadded directives
  • Loading branch information
xabbuh committed Feb 9, 2016
2 parents d9f6264 + f8b560d commit b986eb1
Show file tree
Hide file tree
Showing 156 changed files with 92 additions and 1,745 deletions.
4 changes: 2 additions & 2 deletions best_practices/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ Canonical Parameters
Define all your application's parameters in the
``app/config/parameters.yml.dist`` file.

Since version 2.3, Symfony includes a configuration file called ``parameters.yml.dist``,
which stores the canonical list of configuration parameters for the application.
Symfony includes a configuration file called ``parameters.yml.dist``, which
stores the canonical list of configuration parameters for the application.

Whenever a new configuration parameter is defined for the application, you
should also add it to this file and submit the changes to your version control
Expand Down
3 changes: 1 addition & 2 deletions best_practices/creating-the-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ ProductBundle, then there's no advantage to having two separate bundles.
Create only one bundle called AppBundle for your application logic

Implementing a single AppBundle bundle in your projects will make your code
more concise and easier to understand. Starting in Symfony 2.6, the official
Symfony documentation uses the AppBundle name.
more concise and easier to understand.

.. note::

Expand Down
7 changes: 4 additions & 3 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ makes them easier to re-use later.

Add buttons in the templates, not in the form classes or the controllers.

Since Symfony 2.3, you can add buttons as fields on your form. This is a nice
way to simplify the template that renders your form. But if you add the buttons
directly in your form class, this would effectively limit the scope of that form:
The Symfony Form component allows you to add buttons as fields on your form.
This is a nice way to simplify the template that renders your form. But if you
add the buttons directly in your form class, this would effectively limit the
scope of that form:

.. code-block:: php
Expand Down
6 changes: 3 additions & 3 deletions best_practices/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Of all the available translation formats, only XLIFF and gettext have broad
support in the tools used by professional translators. And since it's based
on XML, you can validate XLIFF file contents as you write them.

Symfony 2.6 added support for notes inside XLIFF files, making them more
user-friendly for translators. At the end, good translations are all about
context, and these XLIFF notes allow you to define that context.
Symfony supports notes in XLIFF files, making them more user-friendly for
translators. At the end, good translations are all about context, and these
XLIFF notes allow you to define that context.

.. tip::

Expand Down
1 change: 0 additions & 1 deletion best_practices/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ the same ``getAuthorEmail`` logic you used above:
use Symfony\Component\Security\Core\User\UserInterface;
use AppBundle\Entity\Post;
// Voter class requires Symfony 2.8 or higher version
class PostVoter extends Voter
{
const CREATE = 'create';
Expand Down
33 changes: 0 additions & 33 deletions book/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,9 @@ You've also assigned each a "type" (e.g. ``TextType`` and ``DateType``),
represented by its fully qualified class name. Among other things, it determines
which HTML form tag(s) is rendered for that field.

.. versionadded:: 2.8
To denote the form type, you have to use the fully qualified class name - like
``TextType::class`` in PHP 5.5+ or ``Symfony\Component\Form\Extension\Core\Type\TextType``.
Before Symfony 2.8, you could use an alias for each type like ``text`` or
``date``. The old alias syntax will still work until Symfony 3.0. For more details,
see the `2.8 UPGRADE Log`_.

Finally, you added a submit button with a custom label for submitting the form to
the server.

.. versionadded:: 2.3
Support for submit buttons was introduced in Symfony 2.3. Before that, you had
to add buttons to the form's HTML manually.

Symfony comes with many built-in types that will be discussed shortly
(see :ref:`book-forms-type-reference`).

Expand Down Expand Up @@ -259,12 +248,6 @@ your controller::
is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the
view (like validation errors).

.. versionadded:: 2.3
The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` method
was introduced in Symfony 2.3. Previously, the ``$request`` was passed
to the ``submit`` method - a strategy which is deprecated and will be
removed in Symfony 3.0. For details on that method, see :ref:`cookbook-form-submit-request`.

This controller follows a common pattern for handling forms, and has three
possible paths:

Expand Down Expand Up @@ -313,9 +296,6 @@ possible paths:
Submitting Forms with Multiple Buttons
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
Support for buttons in forms was introduced in Symfony 2.3.

When your form contains more than one submit button, you will want to check
which of the buttons was clicked to adapt the program flow in your controller.
To do this, add a second button with the caption "Save and add" to your form::
Expand Down Expand Up @@ -491,10 +471,6 @@ you'll need to specify which validation group(s) your form should use::
'validation_groups' => array('registration'),
))->add(...);

.. versionadded:: 2.7
The ``configureOptions()`` method was introduced in Symfony 2.7. Previously,
the method was called ``setDefaultOptions()``.

If you're creating :ref:`form classes <book-form-creating-form-classes>` (a
good practice), then you'll need to add the following to the ``configureOptions()``
method::
Expand All @@ -517,9 +493,6 @@ be used to validate the underlying object.
Disabling Validation
~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
The ability to set ``validation_groups`` to false was introduced in Symfony 2.3.

Sometimes it is useful to suppress the validation of a form altogether. For
these cases you can set the ``validation_groups`` option to ``false``::

Expand Down Expand Up @@ -620,9 +593,6 @@ work in the book section about :ref:`validation groups <book-validation-validati
Groups based on the Clicked Button
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
Support for buttons in forms was introduced in Symfony 2.3.

When your form contains multiple submit buttons, you can change the validation
group depending on which button is used to submit the form. For example,
consider a form in a wizard that lets you advance to the next step or go back
Expand Down Expand Up @@ -1044,8 +1014,6 @@ to the ``form()`` or the ``form_start()`` helper:

<!-- app/Resources/views/default/newAction.html.php -->
<?php echo $view['form']->start($form, array(
// The path() method was introduced in Symfony 2.8. Prior to 2.8,
// you had to use generate().
'action' => $view['router']->path('target_route'),
'method' => 'GET',
)) ?>
Expand Down Expand Up @@ -1981,4 +1949,3 @@ Learn more from the Cookbook
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
.. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form
2 changes: 1 addition & 1 deletion book/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ content:
{
"require": {
"symfony/symfony": "2.6.*"
"symfony/symfony": "3.0.*"
},
"autoload": {
"files": ["model.php","controllers.php"]
Expand Down
7 changes: 1 addition & 6 deletions book/http_cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1095,12 +1095,7 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:

<!-- ... or a URL -->
<?php echo $view['actions']->render(
// The url() method was introduced in Symfony 2.8. Prior to 2.8,
// you had to use generate($name, $parameters, UrlGeneratorInterface::ABSOLUTE_URL)
$view['router']->url(
'latest_news',
array('maxPerPage' => 5),
),
$view['router']->url('latest_news', array('maxPerPage' => 5)),
array('strategy' => 'esi'),
) ?>

Expand Down
2 changes: 1 addition & 1 deletion book/page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,6 @@ There's also a :doc:`Cookbook </cookbook/index>` *packed* with more advanced
Have fun!

.. _`Joyful Development with Symfony`: http://knpuniversity.com/screencast/symfony/first-page
.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/2.7/app/Resources/views/base.html.twig
.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/3.0/app/Resources/views/base.html.twig
.. _`Composer`: https://getcomposer.org
.. _`find open source bundles`: http://knpbundles.com
10 changes: 0 additions & 10 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1543,10 +1543,6 @@ a template helper function:
Read this blog post.
</a>

.. versionadded:: 2.8
The ``path()`` PHP templating helper was introduced in Symfony 2.8. Prior
to 2.8, you had to use the ``generate()`` helper method.

.. index::
single: Routing; Absolute URLs

Expand Down Expand Up @@ -1581,12 +1577,6 @@ URL) rather than the ``path()`` function (which generates a relative URL):
Read this blog post.
</a>

.. versionadded:: 2.8
The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior
to 2.8, you had to use the ``generate()`` helper method with
``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL``
passed as the third argument.

.. note::

The host that's used when generating an absolute URL is automatically
Expand Down
14 changes: 1 addition & 13 deletions book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ else, you'll want to encode their passwords. The best algorithm to use is
));
Of course, your users' passwords now need to be encoded with this exact algorithm.
For hardcoded users, since 2.7 you can use the built-in command:
For hardcoded users, you can use the built-in command:

.. code-block:: bash
Expand Down Expand Up @@ -894,18 +894,6 @@ the built-in ``is_granted()`` helper function:
<a href="...">Delete</a>
<?php endif ?>

.. note::

In Symfony versions previous to 2.8, using the ``is_granted()`` function
in a page that wasn't behind a firewall resulted in an exception. That's why
you also needed to check first for the existence of the user:

.. code-block:: html+twig

{% if app.user and is_granted('ROLE_ADMIN') %}

Starting from Symfony 2.8, the ``app.user and ...`` check is no longer needed.

Securing other Services
.......................

Expand Down
12 changes: 7 additions & 5 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -811,13 +811,15 @@ Injecting the dependency by the setter method just needs a change of syntax:
"property injection".

.. _book-container-request-stack:
.. _injecting-the-request:

Injecting the Request
~~~~~~~~~~~~~~~~~~~~~
Accessing the Request in a Service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As of Symfony 2.4, instead of injecting the ``request`` service, you should
inject the ``request_stack`` service and access the ``Request`` by calling
the :method:`Symfony\\Component\\HttpFoundation\\RequestStack::getCurrentRequest`
Whenever you need to access the current request in a service, you can either
add it as an argument to the methods that need the request or inject the
``request_stack`` service and access the ``Request`` by calling the
:method:`Symfony\\Component\\HttpFoundation\\RequestStack::getCurrentRequest`
method::

namespace Acme\HelloBundle\Newsletter;
Expand Down
21 changes: 0 additions & 21 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,6 @@ you set `with_context`_ to false).
maps (i.e. an array with named keys). If you needed to pass in multiple
elements, it would look like this: ``{'foo': foo, 'bar': bar}``.

.. versionadded:: 2.3
The `include() function`_ is available since Symfony 2.3. Prior, the
`{% include %} tag`_ was used.

.. index::
single: Templating; Embedding action

Expand Down Expand Up @@ -709,9 +705,6 @@ tags:
array('renderer' => 'hinclude')
) ?>
<!-- The url() method was introduced in Symfony 2.8. Prior to 2.8, you
had to use generate() with UrlGeneratorInterface::ABSOLUTE_URL
passed as the third argument. -->
<?php echo $view['actions']->render(
$view['router']->url('...'),
array('renderer' => 'hinclude')
Expand Down Expand Up @@ -921,8 +914,6 @@ To link to the page, just use the ``path`` Twig function and refer to the route:

.. code-block:: html+php

<!-- The path() method was introduced in Symfony 2.8. Prior to 2.8, you
had to use generate(). -->
<a href="<?php echo $view['router']->path('_welcome') ?>">Home</a>

As expected, this will generate the URL ``/``. Now, for a more complicated
Expand Down Expand Up @@ -1002,8 +993,6 @@ correctly:

<!-- app/Resources/views/Article/recent_list.html.php -->
<?php foreach ($articles in $article): ?>
<!-- The path() method was introduced in Symfony 2.8. Prior to 2.8,
you had to use generate(). -->
<a href="<?php echo $view['router']->path('article_show', array(
'slug' => $article->getSlug(),
)) ?>">
Expand All @@ -1028,12 +1017,6 @@ correctly:
array()
) ?>">Home</a>

.. versionadded:: 2.8
The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior
to 2.8, you had to use the ``generate()`` helper method with
``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL``
passed as the third argument.

.. index::
single: Templating; Linking to assets

Expand Down Expand Up @@ -1238,8 +1221,6 @@ is a :class:`Symfony\\Bundle\\FrameworkBundle\\Templating\\GlobalVariables`
instance which will give you access to some application specific variables
automatically:

``app.security`` (deprecated as of 2.6)
The security context.
``app.user``
The current user object.
``app.request``
Expand Down Expand Up @@ -1697,8 +1678,6 @@ key in the parameter hash:

.. code-block:: html+php

<!-- The path() method was introduced in Symfony 2.8. Prior to 2.8, you
had to use generate(). -->
<a href="<?php echo $view['router']->path('article_show', array(
'id' => 123,
'_format' => 'pdf',
Expand Down
5 changes: 0 additions & 5 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,6 @@ The Client supports many operations that can be done in a real browser::
Accessing Internal Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
The :method:`Symfony\\Component\\BrowserKit\\Client::getInternalRequest`
and :method:`Symfony\\Component\\BrowserKit\\Client::getInternalResponse`
methods were introduced in Symfony 2.3.

If you use the client to test your application, you might want to access the
client's internal objects::

Expand Down
18 changes: 0 additions & 18 deletions book/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ following:
Protected and private properties can also be validated, as well as "getter"
methods (see :ref:`validator-constraint-targets`).

.. versionadded:: 2.7
As of Symfony 2.7, XML and Yaml constraint files located in the
``Resources/config/validation`` sub-directory of a bundle are loaded. Prior
to 2.7, only ``Resources/config/validation.yml`` (or ``.xml``) were loaded.

.. index::
single: Validation; Using the validator

Expand Down Expand Up @@ -882,12 +877,8 @@ the class name or the string ``Default``.
To tell the validator to use a specific group, pass one or more group names
as the third argument to the ``validate()`` method::

// If you're using the new 2.5 validation API (you probably are!)
$errors = $validator->validate($author, null, array('registration'));

// If you're using the old 2.4 validation API, pass the group names as the second argument
// $errors = $validator->validate($author, array('registration'));

If no groups are specified, all constraints that belong to the group ``Default``
will be applied.

Expand Down Expand Up @@ -1248,20 +1239,11 @@ it looks like this::
$emailConstraint->message = 'Invalid email address';

// use the validator to validate the value
// If you're using the new 2.5 validation API (you probably are!)
$errorList = $this->get('validator')->validate(
$email,
$emailConstraint
);

// If you're using the old 2.4 validation API
/*
$errorList = $this->get('validator')->validateValue(
$email,
$emailConstraint
);
*/

if (0 === count($errorList)) {
// ... this IS a valid email address, do something
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/class_loader/debug_class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Debugging a Class Loader
.. caution::

The ``DebugClassLoader`` from the ClassLoader component was deprecated
in Symfony 2.5 and will be removed in Symfony 3.0. Use the
in Symfony 2.5 and removed in Symfony 3.0. Use the
:doc:`DebugClassLoader provided by the Debug component </components/debug/class_loader>`.
4 changes: 0 additions & 4 deletions components/config/definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,6 @@ and in XML:
<!-- entries-per-page: This value is only used for the search results page. -->
<config entries-per-page="25" />
.. 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
Loading

0 comments on commit b986eb1

Please sign in to comment.