Skip to content

Commit ab9d232

Browse files
committed
feature #8622 Removed deprecated features and notices (javiereguiluz, weaverryan)
This PR was merged into the master branch. Discussion ---------- Removed deprecated features and notices @xabbuh and @weaverryan to avoid a nightmare or rebases and problems, could we please give top priority to merging this PR? Thanks! It doesn't have to be perfect or 100% completed. We can do more fixes in another PR. Thanks! ----- Some articles explain things that are removed. Instead of removing those articles entirely and to avoid user confusion, I propose to keep those articles but explain that those features no longer exist. For example, `security/acl.rst` now contains the following: ```rst .. index:: single: Security; Access Control Lists (ACLs) How to Use Access Control Lists (ACLs) ====================================== .. caution:: ACL support was removed in Symfony 4.0. Install the `Symfony ACL bundle`_ and refer to its documentation if you want to keep using ACL. .. _`Symfony ACL bundle`: https://github.com/symfony/acl-bundle ``` Articles like this one: * security/acl.rst * security/acl_advanced.rst * components/event_dispatcher/container_aware_dispatcher.rst We can remove all these deprecated articles in 4.1 ----- @iltar could you please create a PR to update the changes related to "controller arguments" in these two articles? Thanks! * `components/http_kernel.rst` * `create_framework/http_kernel_controller_resolver.rst` I don't understand the changes well (`ControllerResolverInterface` removed `getArguments()`) ----- @HeahDude could you please create a PR to update the changes needed about the deprecation of using `false` in `property_path` instead of `mapped` in `reference/forms/types/options/property_path.rst.inc`? Thanks! ----- There is a pending deprecation message in `security/multiple_user_providers.rst` ... but that's fixed in the pending PR #8612. ----- A final question: I've removed the explanation of the deprecated `kernel.root_dir` in `reference/configuration/kernel.rst` and kept only `kernel.project_dir`. Would you instead prefer to keep a reference to the still heavily used `kernel.root_dir` to explain that it's deprecated? Commits ------- 02c676a fixing old reference eb53f14 Fixing test failure 47a224a Fixed ater Wouter's review 597b75b Removed more references about profiler.matcher option 0266046 Removed deprecated features and notices
2 parents 0b62cc0 + 02c676a commit ab9d232

File tree

86 files changed

+82
-1449
lines changed

Some content is hidden

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

86 files changed

+82
-1449
lines changed

best_practices/configuration.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,5 @@ through environment variables:
210210
# ...
211211
password: "%env(DB_PASSWORD)%"
212212
213-
.. versionadded:: 3.2
214-
Support for runtime environment variables via the ``%env(...)%`` syntax
215-
was added in Symfony 3.2. Prior to version 3.2, you needed to use the
216-
:doc:`special SYMFONY__ variables </configuration/external_parameters>`.
217-
218213
.. _`feature toggles`: https://en.wikipedia.org/wiki/Feature_toggle
219214
.. _`constant() function`: http://twig.sensiolabs.org/doc/functions/constant.html

bundles/extension.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,10 @@ read more about it, see the ":doc:`/bundles/configuration`" article.
129129
Adding Classes to Compile
130130
-------------------------
131131

132-
.. versionadded:: 3.3
133-
This technique is discouraged and the ``addClassesToCompile()`` method was
134-
deprecated in Symfony 3.3 because modern PHP versions make it unnecessary.
135-
136132
Symfony creates a big ``classes.php`` file in the cache directory to aggregate
137133
the contents of the PHP classes that are used in every request. This reduces the
138134
I/O operations and increases the application performance.
139135

140-
.. versionadded:: 3.2
141-
The ``addAnnotatedClassesToCompile()`` method was added in Symfony 3.2.
142-
143136
Your bundles can also add their own classes into this file thanks to the
144137
``addClassesToCompile()`` and ``addAnnotatedClassesToCompile()`` methods (both
145138
work in the same way, but the second one is for classes that contain PHP
@@ -173,9 +166,6 @@ class names::
173166
If some class extends from other classes, all its parents are automatically
174167
included in the list of classes to compile.
175168

176-
.. versionadded:: 3.2
177-
The option to add classes to compile using patterns was introduced in Symfony 3.2.
178-
179169
The classes to compile can also be added using file path patterns::
180170

181171
// ...

bundles/inheritance.rst

Lines changed: 3 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -6,107 +6,6 @@ How to Use Bundle Inheritance to Override Parts of a Bundle
66

77
.. caution::
88

9-
Bundle inheritance is deprecated since Symfony 3.4 and will be removed in
10-
4.0.
11-
12-
When working with third-party bundles, you'll probably come across a situation
13-
where you want to override a file in that third-party bundle with a file
14-
in one of your own bundles. Symfony gives you a very convenient way to override
15-
things like controllers, templates, and other files in a bundle's
16-
``Resources/`` directory.
17-
18-
For example, suppose that you have installed `FOSUserBundle`_, but you want to
19-
override its base ``layout.html.twig`` template, as well as one of its
20-
controllers.
21-
22-
First, create a new bundle called UserBundle and enable it in your application.
23-
Then, register the third-party FOSUserBundle as the "parent" of your bundle::
24-
25-
// src/UserBundle/UserBundle.php
26-
namespace UserBundle;
27-
28-
use Symfony\Component\HttpKernel\Bundle\Bundle;
29-
30-
class UserBundle extends Bundle
31-
{
32-
public function getParent()
33-
{
34-
return 'FOSUserBundle';
35-
}
36-
}
37-
38-
By making this simple change, you can now override several parts of the FOSUserBundle
39-
simply by creating a file with the same name.
40-
41-
.. note::
42-
43-
Despite the method name, there is no parent/child relationship between
44-
the bundles, it is just a way to extend and override an existing bundle.
45-
46-
Overriding Controllers
47-
~~~~~~~~~~~~~~~~~~~~~~
48-
49-
Suppose you want to add some functionality to the ``registerAction()`` of a
50-
``RegistrationController`` that lives inside FOSUserBundle. To do so,
51-
just create your own ``RegistrationController.php`` file, override the bundle's
52-
original method, and change its functionality::
53-
54-
// src/UserBundle/Controller/RegistrationController.php
55-
namespace UserBundle\Controller;
56-
57-
use FOS\UserBundle\Controller\RegistrationController as BaseController;
58-
59-
class RegistrationController extends BaseController
60-
{
61-
public function registerAction()
62-
{
63-
$response = parent::registerAction();
64-
65-
// ... do custom stuff
66-
return $response;
67-
}
68-
}
69-
70-
.. tip::
71-
72-
Depending on how severely you need to change the behavior, you might
73-
call ``parent::registerAction()`` or completely replace its logic with
74-
your own.
75-
76-
.. note::
77-
78-
Overriding controllers in this way only works if the bundle refers to
79-
the controller using the standard ``FOSUserBundle:Registration:register``
80-
syntax in routes and templates. This is the best practice.
81-
82-
Overriding Resources: Templates, Routing, etc
83-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84-
85-
Most resources can also be overridden, simply by creating a file in the same
86-
location as your parent bundle.
87-
88-
For example, it's very common to need to override the FOSUserBundle's
89-
``layout.html.twig`` template so that it uses your application's base layout.
90-
Since the file lives at ``Resources/views/layout.html.twig`` in the FOSUserBundle,
91-
you can create your own file in the same location of UserBundle. Symfony will
92-
ignore the file that lives inside the FOSUserBundle entirely, and use your file
93-
instead.
94-
95-
The same goes for routing files and some other resources.
96-
97-
.. note::
98-
99-
The overriding of resources only works when you refer to resources with
100-
the ``@FOSUserBundle/Resources/config/routing/security.xml`` method.
101-
You need to use the ``@BundleName`` shortcut when referring to resources
102-
so they can be successfully overridden (except templates, which are
103-
overridden in a different way, as explained in :doc:`/templating/overriding`).
104-
105-
.. caution::
106-
107-
Translation and validation files do not work in the same way as described
108-
above. Read ":ref:`override-translations`" if you want to learn how to
109-
override translations and see ":ref:`override-validation`" for tricks to
110-
override the validation.
111-
112-
.. _`FOSUserBundle`: https://github.com/friendsofsymfony/fosuserbundle
9+
Bundle inheritance was removed in Symfony 4.0, but you can
10+
:doc:`override any part of a bundle </bundles/override>` without
11+
using bundle inheritance.

bundles/override.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
How to Override any Part of a Bundle
55
====================================
66

7-
This document is a quick reference for how to override different parts of
8-
third-party bundles without using :doc:`/bundles/inheritance`, which is
9-
deprecated since Symfony 3.4.
7+
When using a third-party bundle, you might want to customize or override some of
8+
its features. This document describes ways of overriding the most common
9+
features of a bundle.
1010

1111
.. tip::
1212

components/cache.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ The Cache Component
1313
It is designed to have a low overhead and it ships with ready to use adapters
1414
for the most common caching backends.
1515

16-
.. versionadded:: 3.3
17-
The PSR-16 "Simple Cache" implementation was introduced in Symfony 3.3.
18-
1916
Installation
2017
------------
2118

@@ -78,7 +75,7 @@ Now you can create, retrieve, update and delete items using this object::
7875

7976
// remove the cache key
8077
$cache->delete('stats.num_products');
81-
78+
8279
// clear *all* cache keys
8380
$cache->clear();
8481

components/cache/adapters/memcached_adapter.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
Memcached Cache Adapter
88
=======================
99

10-
.. versionadded:: 3.3
11-
12-
The Memcached adapter was introduced in Symfony 3.3.
13-
1410
This adapter stores the values in-memory using one (or more) `Memcached server`_
1511
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the
1612
:ref:`Redis adapter <redis-adapter>`, it is not limited to the current server's

components/cache/adapters/pdo_doctrine_dbal_adapter.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
PDO & Doctrine DBAL Cache Adapter
88
=================================
99

10-
.. versionadded:: 3.2
11-
12-
The PDO & Doctrine DBAL adapter was introduced in Symfony 3.2.
13-
14-
1510
This adapter stores the cache items in an SQL database. It requires a `PDO`_,
1611
`Doctrine DBAL Connection`_, or `Data Source Name (DSN)`_ as its first parameter, and
1712
optionally a namespace, default cache lifetime, and options array as its second,

components/cache/cache_invalidation.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ The Symfony Cache component provides two mechanisms to help solving this problem
2020
Using Cache Tags
2121
----------------
2222

23-
.. versionadded:: 3.2
24-
Tags based invalidation was introduced in Symfony 3.2.
25-
2623
To benefit from tags based invalidation, you need to attach the proper tags to
2724
each cached item. Each tag is a plain string identifier that you can use at any
2825
time to trigger the removal of all items associated with this tag.

components/config/definition.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,11 @@ Or you may define a prototype for each node inside an array node::
186186
->end()
187187
;
188188

189-
.. versionadded:: 3.3
190-
The ``arrayPrototype()`` method (and the related ``booleanPrototype()``
191-
``integerPrototype()``, ``floatPrototype()``, ``scalarPrototype()`` and
192-
``enumPrototype()``) was introduced in Symfony 3.3. In previous versions,
193-
you needed to use ``prototype('array')``, ``prototype('boolean')``, etc.
194-
195189
A prototype can be used to add a definition which may be repeated many times
196190
inside the current node. According to the prototype definition in the example
197191
above, it is possible to have multiple connection arrays (containing a ``driver``,
198192
``host``, etc.).
199193

200-
.. versionadded:: 3.3
201-
The ``castToArray()`` helper was added in Symfony 3.3.
202-
203194
Sometimes, to improve the user experience of your application or bundle, you may
204195
allow to use a simple string or numeric value where an array value is required.
205196
Use the ``castToArray()`` helper to turn those variables into arrays::

components/console/events.rst

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,24 @@ C/C++ standard.::
8383
}
8484
});
8585

86-
The ``ConsoleEvents::EXCEPTION`` Event
87-
--------------------------------------
88-
89-
.. versionadded:: 3.3
90-
The ``ConsoleEvents::EXCEPTION`` event was deprecated in Symfony 3.3. Use
91-
the ``ConsoleEvents::ERROR`` event instead.
86+
The ``ConsoleEvents::ERROR`` Event
87+
----------------------------------
9288

9389
**Typical Purposes**: Handle exceptions thrown during the execution of a
9490
command.
9591

96-
Whenever an exception is thrown by a command, the ``ConsoleEvents::EXCEPTION``
97-
event is dispatched. A listener can wrap or change the exception or do
98-
anything useful before the exception is thrown by the application.
92+
Whenever an exception is thrown by a command, including those triggered from
93+
event listeners, the ``ConsoleEvents::ERROR`` event is dispatched. A listener
94+
can wrap or change the exception or do anything useful before the exception is
95+
thrown by the application.
9996

10097
Listeners receive a
10198
:class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent` event::
10299

103-
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
100+
use Symfony\Component\Console\Event\ConsoleErrorEvent;
104101
use Symfony\Component\Console\ConsoleEvents;
105102

106-
$dispatcher->addListener(ConsoleEvents::EXCEPTION, function (ConsoleExceptionEvent $event) {
103+
$dispatcher->addListener(ConsoleEvents::ERROR, function (ConsoleErrorEvent $event) {
107104
$output = $event->getOutput();
108105

109106
$command = $event->getCommand();
@@ -114,22 +111,9 @@ Listeners receive a
114111
$exitCode = $event->getExitCode();
115112

116113
// change the exception to another one
117-
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
114+
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getError()));
118115
});
119116

120-
The ``ConsoleEvents::ERROR`` Event
121-
----------------------------------
122-
123-
.. versionadded:: 3.3
124-
The ``ConsoleEvents::ERROR`` event was introduced in Symfony 3.3.
125-
126-
**Typical Purposes**: Handle exceptions thrown during the execution of a
127-
command.
128-
129-
This event is an improved version of the ``ConsoleEvents::EXCEPTION`` event,
130-
because it can handle every exception thrown during the execution of a command,
131-
including those triggered from event listeners.
132-
133117
The ``ConsoleEvents::TERMINATE`` Event
134118
--------------------------------------
135119

components/console/helpers/questionhelper.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ will be autocompleted as the user types::
170170
{
171171
// ...
172172
$helper = $this->getHelper('question');
173-
173+
174174
$bundles = array('AcmeDemoBundle', 'AcmeBlogBundle', 'AcmeStoreBundle');
175175
$question = new Question('Please enter the name of a bundle', 'FooBundle');
176176
$question->setAutocompleterValues($bundles);
@@ -191,7 +191,7 @@ convenient for passwords::
191191
{
192192
// ...
193193
$helper = $this->getHelper('question');
194-
194+
195195
$question = new Question('What is the database password?');
196196
$question->setHidden(true);
197197
$question->setHiddenFallback(false);
@@ -229,9 +229,6 @@ convenient for passwords::
229229
// ...
230230
}
231231

232-
.. versionadded:: 3.3
233-
The ``QuestionHelper::disableStty()`` method was introduced in Symfony 3.3.
234-
235232
Normalizing the Answer
236233
----------------------
237234

@@ -249,7 +246,7 @@ method::
249246
{
250247
// ...
251248
$helper = $this->getHelper('question');
252-
249+
253250
$question = new Question('Please enter the name of the bundle', 'AppBundle');
254251
$question->setNormalizer(function ($value) {
255252
// $value can be null here
@@ -369,9 +366,6 @@ from the command line, you need to set the inputs that the command expects::
369366
// $this->assertRegExp('/.../', $commandTester->getDisplay());
370367
}
371368

372-
.. versionadded:: 3.2
373-
The ``CommandTester::setInputs()`` method was introduced in Symfony 3.2.
374-
375369
By calling :method:`Symfony\\Component\\Console\\Tester\\CommandTester::setInputs`,
376370
you imitate what the console would do internally with all user input through the CLI.
377371
This method takes an array as only argument with, for each input that the command expects,

components/console/logger.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ constructor::
106106
Errors
107107
------
108108

109-
.. versionadded:: 3.2
110-
The ``hasErrored()`` method was introduced in Symfony 3.2.
111-
112109
The Console logger includes a ``hasErrored()`` method which returns ``true`` as
113110
soon as any error message has been logged during the execution of the command.
114111
This is useful to decide which status code to return as the result of executing

components/console/usage.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,3 @@ can run it with:
156156
If you enter a short command that's ambiguous (i.e. there are more than one
157157
command that match), then no command will be run and some suggestions of
158158
the possible commands to choose from will be output.
159-
160-
.. versionadded:: 3.4
161-
Case-insensitivity of command shortcuts was introduced in Symfony 3.4. In
162-
previous Symfony versions, shortcuts had to match the case of the original
163-
command name (e.g. ``d:g`` was not the same shortcut as ``D:G``).

components/dependency_injection/compilation.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ been run, use::
423423
PassConfig::TYPE_AFTER_REMOVING
424424
);
425425

426-
.. versionadded:: 3.2
427-
The option to prioritize compiler passes was added in Symfony 3.2.
428-
429426
You can also control the order in which compiler passes are run for each
430427
compilation phase. Use the optional third argument of ``addCompilerPass()`` to
431428
set the priority as an integer number. The default priority is ``0`` and the higher

0 commit comments

Comments
 (0)