Skip to content

Commit bd57d7d

Browse files
committed
Deprecate Symfony\Bundle\FrameworkBundle\Controller\Controller
1 parent 6a4de22 commit bd57d7d

File tree

6 files changed

+20
-10
lines changed

6 files changed

+20
-10
lines changed

UPGRADE-5.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ FrameworkBundle
9191
* Removed `Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser`.
9292
* Warming up a router in `RouterCacheWarmer` that does not implement the `WarmableInterface` is not supported anymore.
9393
* The `RequestDataCollector` class has been removed. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
94+
* Removed `Symfony\Bundle\FrameworkBundle\Controller\Controller`. Use `Symfony\Bundle\FrameworkBundle\Controller\AbstractController` instead.
9495

9596
HttpFoundation
9697
--------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CHANGELOG
88
* Allowed configuring PDO-based cache pools via a new `cache.adapter.pdo` abstract service
99
* Deprecated auto-injection of the container in AbstractController instances, register them as service subscribers instead
1010
* Deprecated processing of services tagged `security.expression_language_provider` in favor of a new `AddExpressionLanguageProvidersPass` in SecurityBundle.
11+
* Deprecated the `Symfony\Bundle\FrameworkBundle\Controller\Controller` class in favor of `Symfony\Bundle\FrameworkBundle\Controller\AbstractController`.
1112
* Enabled autoconfiguration for `Psr\Log\LoggerAwareInterface`
1213

1314
4.1.0

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
1515
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
1616

17+
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2. Use %s instead.', Controller::class, AbstractController::class), E_USER_DEPRECATED);
18+
1719
/**
1820
* Controller is a simple implementation of a Controller.
1921
*
2022
* It provides methods to common features needed in controllers.
2123
*
24+
* @deprecated since Symfony 4.2. Use {@see AbstractController} instead.
25+
*
2226
* @author Fabien Potencier <fabien@symfony.com>
2327
*/
2428
abstract class Controller implements ContainerAwareInterface

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Bridge\Monolog\Processor\ProcessorInterface;
1919
use Symfony\Bridge\Twig\Extension\CsrfExtension;
2020
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
21-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
2221
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
2322
use Symfony\Bundle\FullStack;
2423
use Symfony\Component\Cache\Adapter\AbstractAdapter;
@@ -296,7 +295,6 @@ public function load(array $configs, ContainerBuilder $container)
296295

297296
// Added explicitly so that we don't rely on the class map being dumped to make it work
298297
'Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController',
299-
'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
300298
));
301299

302300
$container->registerForAutoconfiguration(Command::class)
@@ -313,7 +311,7 @@ public function load(array $configs, ContainerBuilder $container)
313311
->addTag('controller.argument_value_resolver');
314312
$container->registerForAutoconfiguration(AbstractController::class)
315313
->addTag('controller.service_arguments');
316-
$container->registerForAutoconfiguration(Controller::class)
314+
$container->registerForAutoconfiguration('Symfony\Bundle\FrameworkBundle\Controller\Controller')
317315
->addTag('controller.service_arguments');
318316
$container->registerForAutoconfiguration(DataCollectorInterface::class)
319317
->addTag('data_collector');

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
1313

14-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15-
14+
/**
15+
* @group legacy
16+
*/
1617
class ControllerTest extends ControllerTraitTest
1718
{
1819
protected function createController()
1920
{
2021
return new TestController();
2122
}
2223
}
23-
24-
class TestController extends Controller
25-
{
26-
use TestControllerTrait;
27-
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
7+
class TestController extends Controller
8+
{
9+
use TestControllerTrait;
10+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy