Skip to content

Commit f8b560d

Browse files
wouterjxabbuh
authored andcommitted
Removed all 2.x versionadded directives
1 parent 266f7bf commit f8b560d

File tree

156 files changed

+92
-1745
lines changed

Some content is hidden

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

156 files changed

+92
-1745
lines changed

best_practices/configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Canonical Parameters
5252
Define all your application's parameters in the
5353
``app/config/parameters.yml.dist`` file.
5454

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

5858
Whenever a new configuration parameter is defined for the application, you
5959
should also add it to this file and submit the changes to your version control

best_practices/creating-the-project.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ ProductBundle, then there's no advantage to having two separate bundles.
114114
Create only one bundle called AppBundle for your application logic
115115

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

120119
.. note::
121120

best_practices/forms.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ makes them easier to re-use later.
8585

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

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

9293
.. code-block:: php
9394

best_practices/i18n.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Of all the available translation formats, only XLIFF and gettext have broad
3232
support in the tools used by professional translators. And since it's based
3333
on XML, you can validate XLIFF file contents as you write them.
3434

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

3939
.. tip::
4040

best_practices/security.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ the same ``getAuthorEmail`` logic you used above:
270270
use Symfony\Component\Security\Core\User\UserInterface;
271271
use AppBundle\Entity\Post;
272272
273-
// Voter class requires Symfony 2.8 or higher version
274273
class PostVoter extends Voter
275274
{
276275
const CREATE = 'create';

book/forms.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,9 @@ You've also assigned each a "type" (e.g. ``TextType`` and ``DateType``),
123123
represented by its fully qualified class name. Among other things, it determines
124124
which HTML form tag(s) is rendered for that field.
125125

126-
.. versionadded:: 2.8
127-
To denote the form type, you have to use the fully qualified class name - like
128-
``TextType::class`` in PHP 5.5+ or ``Symfony\Component\Form\Extension\Core\Type\TextType``.
129-
Before Symfony 2.8, you could use an alias for each type like ``text`` or
130-
``date``. The old alias syntax will still work until Symfony 3.0. For more details,
131-
see the `2.8 UPGRADE Log`_.
132-
133126
Finally, you added a submit button with a custom label for submitting the form to
134127
the server.
135128

136-
.. versionadded:: 2.3
137-
Support for submit buttons was introduced in Symfony 2.3. Before that, you had
138-
to add buttons to the form's HTML manually.
139-
140129
Symfony comes with many built-in types that will be discussed shortly
141130
(see :ref:`book-forms-type-reference`).
142131

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

262-
.. versionadded:: 2.3
263-
The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` method
264-
was introduced in Symfony 2.3. Previously, the ``$request`` was passed
265-
to the ``submit`` method - a strategy which is deprecated and will be
266-
removed in Symfony 3.0. For details on that method, see :ref:`cookbook-form-submit-request`.
267-
268251
This controller follows a common pattern for handling forms, and has three
269252
possible paths:
270253

@@ -313,9 +296,6 @@ possible paths:
313296
Submitting Forms with Multiple Buttons
314297
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
315298

316-
.. versionadded:: 2.3
317-
Support for buttons in forms was introduced in Symfony 2.3.
318-
319299
When your form contains more than one submit button, you will want to check
320300
which of the buttons was clicked to adapt the program flow in your controller.
321301
To do this, add a second button with the caption "Save and add" to your form::
@@ -491,10 +471,6 @@ you'll need to specify which validation group(s) your form should use::
491471
'validation_groups' => array('registration'),
492472
))->add(...);
493473

494-
.. versionadded:: 2.7
495-
The ``configureOptions()`` method was introduced in Symfony 2.7. Previously,
496-
the method was called ``setDefaultOptions()``.
497-
498474
If you're creating :ref:`form classes <book-form-creating-form-classes>` (a
499475
good practice), then you'll need to add the following to the ``configureOptions()``
500476
method::
@@ -517,9 +493,6 @@ be used to validate the underlying object.
517493
Disabling Validation
518494
~~~~~~~~~~~~~~~~~~~~
519495

520-
.. versionadded:: 2.3
521-
The ability to set ``validation_groups`` to false was introduced in Symfony 2.3.
522-
523496
Sometimes it is useful to suppress the validation of a form altogether. For
524497
these cases you can set the ``validation_groups`` option to ``false``::
525498

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

623-
.. versionadded:: 2.3
624-
Support for buttons in forms was introduced in Symfony 2.3.
625-
626596
When your form contains multiple submit buttons, you can change the validation
627597
group depending on which button is used to submit the form. For example,
628598
consider a form in a wizard that lets you advance to the next step or go back
@@ -1044,8 +1014,6 @@ to the ``form()`` or the ``form_start()`` helper:
10441014

10451015
<!-- app/Resources/views/default/newAction.html.php -->
10461016
<?php echo $view['form']->start($form, array(
1047-
// The path() method was introduced in Symfony 2.8. Prior to 2.8,
1048-
// you had to use generate().
10491017
'action' => $view['router']->path('target_route'),
10501018
'method' => 'GET',
10511019
)) ?>
@@ -1981,4 +1949,3 @@ Learn more from the Cookbook
19811949
.. _`form_div_layout.html.twig`: https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
19821950
.. _`Cross-site request forgery`: http://en.wikipedia.org/wiki/Cross-site_request_forgery
19831951
.. _`view on GitHub`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form
1984-
.. _`2.8 UPGRADE Log`: https://github.com/symfony/symfony/blob/2.8/UPGRADE-2.8.md#form

book/from_flat_php_to_symfony2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ content:
417417
418418
{
419419
"require": {
420-
"symfony/symfony": "2.6.*"
420+
"symfony/symfony": "3.0.*"
421421
},
422422
"autoload": {
423423
"files": ["model.php","controllers.php"]

book/http_cache.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,12 +1095,7 @@ matter), Symfony uses the standard ``render`` helper to configure ESI tags:
10951095

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

book/page_creation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,6 @@ There's also a :doc:`Cookbook </cookbook/index>` *packed* with more advanced
582582
Have fun!
583583

584584
.. _`Joyful Development with Symfony`: http://knpuniversity.com/screencast/symfony/first-page
585-
.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/2.7/app/Resources/views/base.html.twig
585+
.. _`app/Resources/views/base.html.twig`: https://github.com/symfony/symfony-standard/blob/3.0/app/Resources/views/base.html.twig
586586
.. _`Composer`: https://getcomposer.org
587587
.. _`find open source bundles`: http://knpbundles.com

book/routing.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,10 +1543,6 @@ a template helper function:
15431543
Read this blog post.
15441544
</a>
15451545

1546-
.. versionadded:: 2.8
1547-
The ``path()`` PHP templating helper was introduced in Symfony 2.8. Prior
1548-
to 2.8, you had to use the ``generate()`` helper method.
1549-
15501546
.. index::
15511547
single: Routing; Absolute URLs
15521548

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

1584-
.. versionadded:: 2.8
1585-
The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior
1586-
to 2.8, you had to use the ``generate()`` helper method with
1587-
``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL``
1588-
passed as the third argument.
1589-
15901580
.. note::
15911581

15921582
The host that's used when generating an absolute URL is automatically

book/security.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ else, you'll want to encode their passwords. The best algorithm to use is
511511
));
512512
513513
Of course, your users' passwords now need to be encoded with this exact algorithm.
514-
For hardcoded users, since 2.7 you can use the built-in command:
514+
For hardcoded users, you can use the built-in command:
515515

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

897-
.. note::
898-
899-
In Symfony versions previous to 2.8, using the ``is_granted()`` function
900-
in a page that wasn't behind a firewall resulted in an exception. That's why
901-
you also needed to check first for the existence of the user:
902-
903-
.. code-block:: html+twig
904-
905-
{% if app.user and is_granted('ROLE_ADMIN') %}
906-
907-
Starting from Symfony 2.8, the ``app.user and ...`` check is no longer needed.
908-
909897
Securing other Services
910898
.......................
911899

book/service_container.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,13 +811,15 @@ Injecting the dependency by the setter method just needs a change of syntax:
811811
"property injection".
812812

813813
.. _book-container-request-stack:
814+
.. _injecting-the-request:
814815

815-
Injecting the Request
816-
~~~~~~~~~~~~~~~~~~~~~
816+
Accessing the Request in a Service
817+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
817818

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

823825
namespace Acme\HelloBundle\Newsletter;

book/templating.rst

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,6 @@ you set `with_context`_ to false).
579579
maps (i.e. an array with named keys). If you needed to pass in multiple
580580
elements, it would look like this: ``{'foo': foo, 'bar': bar}``.
581581

582-
.. versionadded:: 2.3
583-
The `include() function`_ is available since Symfony 2.3. Prior, the
584-
`{% include %} tag`_ was used.
585-
586582
.. index::
587583
single: Templating; Embedding action
588584

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

922915
.. code-block:: html+php
923916

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

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

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

1031-
.. versionadded:: 2.8
1032-
The ``url()`` PHP templating helper was introduced in Symfony 2.8. Prior
1033-
to 2.8, you had to use the ``generate()`` helper method with
1034-
``Symfony\Component\Routing\Generator\UrlGeneratorInterface::ABSOLUTE_URL``
1035-
passed as the third argument.
1036-
10371020
.. index::
10381021
single: Templating; Linking to assets
10391022

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

1241-
``app.security`` (deprecated as of 2.6)
1242-
The security context.
12431224
``app.user``
12441225
The current user object.
12451226
``app.request``
@@ -1697,8 +1678,6 @@ key in the parameter hash:
16971678

16981679
.. code-block:: html+php
16991680

1700-
<!-- The path() method was introduced in Symfony 2.8. Prior to 2.8, you
1701-
had to use generate(). -->
17021681
<a href="<?php echo $view['router']->path('article_show', array(
17031682
'id' => 123,
17041683
'_format' => 'pdf',

book/testing.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,6 @@ The Client supports many operations that can be done in a real browser::
420420
Accessing Internal Objects
421421
~~~~~~~~~~~~~~~~~~~~~~~~~~
422422

423-
.. versionadded:: 2.3
424-
The :method:`Symfony\\Component\\BrowserKit\\Client::getInternalRequest`
425-
and :method:`Symfony\\Component\\BrowserKit\\Client::getInternalResponse`
426-
methods were introduced in Symfony 2.3.
427-
428423
If you use the client to test your application, you might want to access the
429424
client's internal objects::
430425

book/validation.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ following:
103103
Protected and private properties can also be validated, as well as "getter"
104104
methods (see :ref:`validator-constraint-targets`).
105105

106-
.. versionadded:: 2.7
107-
As of Symfony 2.7, XML and Yaml constraint files located in the
108-
``Resources/config/validation`` sub-directory of a bundle are loaded. Prior
109-
to 2.7, only ``Resources/config/validation.yml`` (or ``.xml``) were loaded.
110-
111106
.. index::
112107
single: Validation; Using the validator
113108

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

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

888-
// If you're using the old 2.4 validation API, pass the group names as the second argument
889-
// $errors = $validator->validate($author, array('registration'));
890-
891882
If no groups are specified, all constraints that belong to the group ``Default``
892883
will be applied.
893884

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

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

1257-
// If you're using the old 2.4 validation API
1258-
/*
1259-
$errorList = $this->get('validator')->validateValue(
1260-
$email,
1261-
$emailConstraint
1262-
);
1263-
*/
1264-
12651247
if (0 === count($errorList)) {
12661248
// ... this IS a valid email address, do something
12671249
} else {

components/class_loader/debug_class_loader.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Debugging a Class Loader
44
.. caution::
55

66
The ``DebugClassLoader`` from the ClassLoader component was deprecated
7-
in Symfony 2.5 and will be removed in Symfony 3.0. Use the
7+
in Symfony 2.5 and removed in Symfony 3.0. Use the
88
:doc:`DebugClassLoader provided by the Debug component </components/debug/class_loader>`.

components/config/definition.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,6 @@ and in XML:
446446
<!-- entries-per-page: This value is only used for the search results page. -->
447447
<config entries-per-page="25" />
448448
449-
.. versionadded:: 2.6
450-
Since Symfony 2.6, the info will also be added to the exception message
451-
when an invalid type is given.
452-
453449
Optional Sections
454450
-----------------
455451

0 commit comments

Comments
 (0)