Skip to content
Permalink
Browse files

feature #28243 [FrameworkBundle] Deprecate `Symfony\Bundle\FrameworkB…

…undle\Controller\Controller` (sroze)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate `Symfony\Bundle\FrameworkBundle\Controller\Controller`

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      |  no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #28215
| License       | MIT
| Doc PR        | ø

Time to deprecate `Controller`, youpi !! 🎉

Commits
-------

a7e319d Deprecate `Symfony\Bundle\FrameworkBundle\Controller\Controller`
  • Loading branch information...
fabpot committed Aug 28, 2018
2 parents 9cc80ec + a7e319d commit 4edbd60bbb82634a23d4564fb10573253697f3bd
@@ -91,6 +91,7 @@ FrameworkBundle
* Removed `Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser`.
* Warming up a router in `RouterCacheWarmer` that does not implement the `WarmableInterface` is not supported anymore.
* The `RequestDataCollector` class has been removed. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
* Removed `Symfony\Bundle\FrameworkBundle\Controller\Controller`. Use `Symfony\Bundle\FrameworkBundle\Controller\AbstractController` instead.

HttpFoundation
--------------
@@ -8,6 +8,7 @@ CHANGELOG
* Allowed configuring PDO-based cache pools via a new `cache.adapter.pdo` abstract service
* Deprecated auto-injection of the container in AbstractController instances, register them as service subscribers instead
* Deprecated processing of services tagged `security.expression_language_provider` in favor of a new `AddExpressionLanguageProvidersPass` in SecurityBundle.
* Deprecated the `Symfony\Bundle\FrameworkBundle\Controller\Controller` class in favor of `Symfony\Bundle\FrameworkBundle\Controller\AbstractController`.
* Enabled autoconfiguration for `Psr\Log\LoggerAwareInterface`
* Added new "auto" mode for `framework.session.cookie_secure` to turn it on when HTTPS is used

@@ -14,11 +14,15 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use %s instead.', Controller::class, AbstractController::class), E_USER_DEPRECATED);
/**
* Controller is a simple implementation of a Controller.
*
* It provides methods to common features needed in controllers.
*
* @deprecated since Symfony 4.2, use {@see AbstractController} instead.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
abstract class Controller implements ContainerAwareInterface
@@ -19,7 +19,6 @@
use Symfony\Bridge\Monolog\Processor\ProcessorInterface;
use Symfony\Bridge\Twig\Extension\CsrfExtension;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
use Symfony\Bundle\FullStack;
use Symfony\Component\Cache\Adapter\AbstractAdapter;
@@ -299,7 +298,6 @@ public function load(array $configs, ContainerBuilder $container)
// Added explicitly so that we don't rely on the class map being dumped to make it work
'Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController',
'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
));
$container->registerForAutoconfiguration(Command::class)
@@ -316,7 +314,7 @@ public function load(array $configs, ContainerBuilder $container)
->addTag('controller.argument_value_resolver');
$container->registerForAutoconfiguration(AbstractController::class)
->addTag('controller.service_arguments');
$container->registerForAutoconfiguration(Controller::class)
$container->registerForAutoconfiguration('Symfony\Bundle\FrameworkBundle\Controller\Controller')
->addTag('controller.service_arguments');
$container->registerForAutoconfiguration(DataCollectorInterface::class)
->addTag('data_collector');
@@ -11,17 +11,13 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* @group legacy
*/
class ControllerTest extends ControllerTraitTest
{
protected function createController()
{
return new TestController();
}
}
class TestController extends Controller
{
use TestControllerTrait;
}
@@ -0,0 +1,10 @@
<?php
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class TestController extends Controller
{
use TestControllerTrait;
}

0 comments on commit 4edbd60

Please sign in to comment.
You can’t perform that action at this time.