Skip to content

Commit

Permalink
[3.0][HttpKernel] remove deprecated functions and classes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentaubert committed May 16, 2015
1 parent 15f8721 commit 897836f
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 845 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,24 @@ CHANGELOG

* removed `Symfony\Component\HttpKernel\Kernel::init()`
* removed `Symfony\Component\HttpKernel\Kernel::isClassInActiveBundle()` and `Symfony\Component\HttpKernel\KernelInterface::isClassInActiveBundle()`
* removed `Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher::setProfiler()`
* removed `Symfony\Component\HttpKernel\EventListener\FragmentListener::getLocalIpAddresses()`
* removed `Symfony\Component\HttpKernel\EventListener\LocaleListener::setRequest()`
* removed `Symfony\Component\HttpKernel\EventListener\RouterListener::setRequest()`
* removed `Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest()`
* removed `Symfony\Component\HttpKernel\Fragment\FragmentHandler::setRequest()`
* removed `Symfony\Component\HttpKernel\HttpCache\Esi::hasSurrogateEsiCapability()`
* removed `Symfony\Component\HttpKernel\HttpCache\Esi::addSurrogateEsiCapability()`
* removed `Symfony\Component\HttpKernel\HttpCache\Esi::needsEsiParsing()`
* removed `Symfony\Component\HttpKernel\HttpCache\HttpCache::getEsi()`
* removed `Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel`
* removed `Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass`
* removed `Symfony\Component\HttpKernel\EventListener\ErrorsLoggerListener`
* removed `Symfony\Component\HttpKernel\EventListener\EsiListener`
* removed `Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategy`
* removed `Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategyInterface`
* removed `Symfony\Component\HttpKernel\Log\LoggerInterface`
* removed `Symfony\Component\HttpKernel\Log\NullLogger`

2.7.0
-----
Expand Down
8 changes: 2 additions & 6 deletions DataCollector/DumpDataCollector.php
Expand Up @@ -199,12 +199,8 @@ public function getDumps($format, $maxDepthLimit = -1, $maxItemsPerDepth = -1)
$dumps = array();

foreach ($this->data as $dump) {
if (method_exists($dump['data'], 'withMaxDepth')) {
$dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth));
} else {
// getLimitedClone is @deprecated, to be removed in 3.0
$dumper->dump($dump['data']->getLimitedClone($maxDepthLimit, $maxItemsPerDepth));
}
$dumper->dump($dump['data']->withMaxDepth($maxDepthLimit)->withMaxItemsPerDepth($maxItemsPerDepth));

rewind($data);
$dump['data'] = stream_get_contents($data);
ftruncate($data, 0);
Expand Down
17 changes: 0 additions & 17 deletions Debug/TraceableEventDispatcher.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Debug;

use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher as BaseTraceableEventDispatcher;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\Event;

Expand All @@ -25,22 +24,6 @@
*/
class TraceableEventDispatcher extends BaseTraceableEventDispatcher
{
/**
* Sets the profiler.
*
* The traceable event dispatcher does not use the profiler anymore.
* The job is now done directly by the Profiler listener and the
* data collectors themselves.
*
* @param Profiler|null $profiler A Profiler instance
*
* @deprecated since version 2.4, to be removed in 3.0.
*/
public function setProfiler(Profiler $profiler = null)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
}

/**
* {@inheritdoc}
*/
Expand Down
77 changes: 0 additions & 77 deletions DependencyInjection/ContainerAwareHttpKernel.php

This file was deleted.

10 changes: 1 addition & 9 deletions DependencyInjection/FragmentRendererPass.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;

/**
Expand Down Expand Up @@ -59,14 +58,7 @@ public function process(ContainerBuilder $container)
}

foreach ($tags as $tag) {
if (!isset($tag['alias'])) {
trigger_error(sprintf('Service "%s" will have to define the "alias" attribute on the "%s" tag as of Symfony 3.0.', $id, $this->rendererTag), E_USER_DEPRECATED);

// register the handler as a non-lazy-loaded one
$definition->addMethodCall('addRenderer', array(new Reference($id)));
} else {
$definition->addMethodCall('addRendererService', array($tag['alias'], $id));
}
$definition->addMethodCall('addRendererService', array($tag['alias'], $id));
}
}
}
Expand Down
25 changes: 0 additions & 25 deletions DependencyInjection/RegisterListenersPass.php

This file was deleted.

52 changes: 0 additions & 52 deletions EventListener/ErrorsLoggerListener.php

This file was deleted.

25 changes: 0 additions & 25 deletions EventListener/EsiListener.php

This file was deleted.

4 changes: 0 additions & 4 deletions EventListener/ExceptionListener.php
Expand Up @@ -107,10 +107,6 @@ protected function duplicateRequest(\Exception $exception, Request $request)
'_controller' => $this->controller,
'exception' => FlattenException::create($exception),
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
// keep for BC -- as $format can be an argument of the controller callable
// see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php
// @deprecated since version 2.4, to be removed in 3.0
'format' => $request->getRequestFormat(),
);
$request = $request->duplicate(null, null, $attributes);
$request->setMethod('GET');
Expand Down
12 changes: 0 additions & 12 deletions EventListener/FragmentListener.php
Expand Up @@ -87,18 +87,6 @@ protected function validateRequest(Request $request)
throw new AccessDeniedHttpException();
}

/**
* @deprecated since version 2.3.19, to be removed in 3.0.
*
* @return string[]
*/
protected function getLocalIpAddresses()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.3.19 and will be removed in 3.0.', E_USER_DEPRECATED);

return array('127.0.0.1', 'fe80::1', '::1');
}

public static function getSubscribedEvents()
{
return array(
Expand Down
23 changes: 0 additions & 23 deletions EventListener/LocaleListener.php
Expand Up @@ -45,29 +45,6 @@ public function __construct($defaultLocale = 'en', RequestContextAwareInterface
$this->router = $router;
}

/**
* Sets the current Request.
*
* This method was used to synchronize the Request, but as the HttpKernel
* is doing that automatically now, you should never call it directly.
* It is kept public for BC with the 2.3 version.
*
* @param Request|null $request A Request instance
*
* @deprecated since version 2.4, to be removed in 3.0.
*/
public function setRequest(Request $request = null)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);

if (null === $request) {
return;
}

$this->setLocale($request);
$this->setRouterContext($request);
}

public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
Expand Down
21 changes: 0 additions & 21 deletions EventListener/ProfilerListener.php
Expand Up @@ -11,7 +11,6 @@

namespace Symfony\Component\HttpKernel\EventListener;

use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
Expand Down Expand Up @@ -49,13 +48,6 @@ class ProfilerListener implements EventSubscriberInterface
*/
public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false, RequestStack $requestStack = null)
{
if (null === $requestStack) {
// Prevent the deprecation notice to be triggered all the time.
// The onKernelRequest() method fires some logic only when the
// RequestStack instance is not provided as a dependency.
trigger_error('Since version 2.4, the '.__METHOD__.' method must accept a RequestStack instance to get the request instead of using the '.__CLASS__.'::onKernelRequest method that will be removed in 3.0.', E_USER_DEPRECATED);
}

$this->profiler = $profiler;
$this->matcher = $matcher;
$this->onlyException = (bool) $onlyException;
Expand All @@ -79,16 +71,6 @@ public function onKernelException(GetResponseForExceptionEvent $event)
$this->exception = $event->getException();
}

/**
* @deprecated since version 2.4, to be removed in 3.0.
*/
public function onKernelRequest(GetResponseEvent $event)
{
if (null === $this->requestStack) {
$this->requests[] = $event->getRequest();
}
}

/**
* Handles the onKernelResponse event.
*
Expand Down Expand Up @@ -154,9 +136,6 @@ public function onKernelTerminate(PostResponseEvent $event)
public static function getSubscribedEvents()
{
return array(
// kernel.request must be registered as early as possible to not break
// when an exception is thrown in any other kernel.request listener
KernelEvents::REQUEST => array('onKernelRequest', 1024),
KernelEvents::RESPONSE => array('onKernelResponse', -100),
KernelEvents::EXCEPTION => 'onKernelException',
KernelEvents::TERMINATE => array('onKernelTerminate', -1024),
Expand Down

0 comments on commit 897836f

Please sign in to comment.