Skip to content
Snippets Groups Projects
Commit ca1aa9e4 authored by catch's avatar catch
Browse files

Issue #3094398 by martin107, alexpott, andypost, klausi: Update Symfony...

Issue #3094398 by martin107, alexpott, andypost, klausi: Update Symfony response and request events to new classes
parent 4276e511
No related branches found
No related tags found
8 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!1012Issue #3226887: Hreflang on non-canonical content pages,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10,!596Issue #3046532: deleting an entity reference field, used in a contextual view, makes the whole site unrecoverable,!496Issue #2463967: Use .user.ini file for PHP settings,!144Issue #2666286: Clean up menu_ui to conform to Drupal coding standards,!16Draft: Resolve #2081585 "History storage",!13Resolve #2903456
Showing
with 67 additions and 67 deletions
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -73,10 +73,10 @@ public function trigger() { ...@@ -73,10 +73,10 @@ public function trigger() {
/** /**
* Checks and disables the replica database server if appropriate. * Checks and disables the replica database server if appropriate.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The Event to process. * The Event to process.
*/ */
public function checkReplicaServer(GetResponseEvent $event) { public function checkReplicaServer(RequestEvent $event) {
// Ignore replica database servers for this request. // Ignore replica database servers for this request.
// //
// In Drupal's distributed database structure, new data is written to the // In Drupal's distributed database structure, new data is written to the
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
use Drupal\Core\Path\PathMatcherInterface; use Drupal\Core\Path\PathMatcherInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -72,10 +72,10 @@ public function __construct(AccountInterface $current_user, CurrentPathStack $cu ...@@ -72,10 +72,10 @@ public function __construct(AccountInterface $current_user, CurrentPathStack $cu
/** /**
* Sets the 'is-active' class on links. * Sets the 'is-active' class on links.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The response event. * The response event.
*/ */
public function onResponse(FilterResponseEvent $event) { public function onResponse(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
// Only care about HTML responses. // Only care about HTML responses.
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Render\AttachmentsResponseProcessorInterface; use Drupal\Core\Render\AttachmentsResponseProcessorInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -40,10 +40,10 @@ public function __construct(AttachmentsResponseProcessorInterface $ajax_response ...@@ -40,10 +40,10 @@ public function __construct(AttachmentsResponseProcessorInterface $ajax_response
/** /**
* Sets the AJAX parameter from the current request. * Sets the AJAX parameter from the current request.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The response event, which contains the current request. * The response event, which contains the current request.
*/ */
public function onRequest(GetResponseEvent $event) { public function onRequest(RequestEvent $event) {
// Pass to the Html class that the current request is an Ajax request. // Pass to the Html class that the current request is an Ajax request.
if ($event->getRequest()->request->get(static::AJAX_REQUEST_PARAMETER)) { if ($event->getRequest()->request->get(static::AJAX_REQUEST_PARAMETER)) {
Html::setIsAjax(TRUE); Html::setIsAjax(TRUE);
...@@ -53,10 +53,10 @@ public function onRequest(GetResponseEvent $event) { ...@@ -53,10 +53,10 @@ public function onRequest(GetResponseEvent $event) {
/** /**
* Renders the ajax commands right before preparing the result. * Renders the ajax commands right before preparing the result.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The response event, which contains the possible AjaxResponse object. * The response event, which contains the possible AjaxResponse object.
*/ */
public function onResponse(FilterResponseEvent $event) { public function onResponse(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
if ($response instanceof AjaxResponse) { if ($response instanceof AjaxResponse) {
$this->ajaxResponseAttachmentsProcessor->processAttachments($response); $this->ajaxResponseAttachmentsProcessor->processAttachments($response);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Cache\CacheableResponseInterface; use Drupal\Core\Cache\CacheableResponseInterface;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -34,10 +34,10 @@ public function __construct(AccountInterface $current_user) { ...@@ -34,10 +34,10 @@ public function __construct(AccountInterface $current_user) {
/** /**
* Adds a cache tag if the 'user.permissions' cache context is present. * Adds a cache tag if the 'user.permissions' cache context is present.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(FilterResponseEvent $event) { public function onRespond(ResponseEvent $event) {
if (!$event->isMasterRequest()) { if (!$event->isMasterRequest()) {
return; return;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
use Drupal\Core\Authentication\AuthenticationProviderInterface; use Drupal\Core\Authentication\AuthenticationProviderInterface;
use Drupal\Core\Session\AccountProxyInterface; use Drupal\Core\Session\AccountProxyInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
...@@ -65,12 +65,12 @@ public function __construct(AuthenticationProviderInterface $authentication_prov ...@@ -65,12 +65,12 @@ public function __construct(AuthenticationProviderInterface $authentication_prov
/** /**
* Authenticates user on request. * Authenticates user on request.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event. * The request event.
* *
* @see \Drupal\Core\Authentication\AuthenticationProviderInterface::authenticate() * @see \Drupal\Core\Authentication\AuthenticationProviderInterface::authenticate()
*/ */
public function onKernelRequestAuthenticate(GetResponseEvent $event) { public function onKernelRequestAuthenticate(RequestEvent $event) {
if ($event->isMasterRequest()) { if ($event->isMasterRequest()) {
$request = $event->getRequest(); $request = $event->getRequest();
if ($this->authenticationProvider->applies($request)) { if ($this->authenticationProvider->applies($request)) {
...@@ -86,10 +86,10 @@ public function onKernelRequestAuthenticate(GetResponseEvent $event) { ...@@ -86,10 +86,10 @@ public function onKernelRequestAuthenticate(GetResponseEvent $event) {
/** /**
* Denies access if authentication provider is not allowed on this route. * Denies access if authentication provider is not allowed on this route.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event. * The request event.
*/ */
public function onKernelRequestFilterProvider(GetResponseEvent $event) { public function onKernelRequestFilterProvider(RequestEvent $event) {
if (isset($this->filter) && $event->isMasterRequest()) { if (isset($this->filter) && $event->isMasterRequest()) {
$request = $event->getRequest(); $request = $event->getRequest();
if ($this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) { if ($this->authenticationProvider->applies($request) && !$this->filter->appliesToRoutedRequest($request, TRUE)) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Cache\CacheableResponseInterface; use Drupal\Core\Cache\CacheableResponseInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -16,10 +16,10 @@ class ClientErrorResponseSubscriber implements EventSubscriberInterface { ...@@ -16,10 +16,10 @@ class ClientErrorResponseSubscriber implements EventSubscriberInterface {
/** /**
* Sets the '4xx-response' cache tag on 4xx responses. * Sets the '4xx-response' cache tag on 4xx responses.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(FilterResponseEvent $event) { public function onRespond(ResponseEvent $event) {
if (!$event->isMasterRequest()) { if (!$event->isMasterRequest()) {
return; return;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
use Drupal\Core\Render\RendererInterface; use Drupal\Core\Render\RendererInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface; use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use Symfony\Component\HttpKernel\Event\ControllerEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -84,10 +84,10 @@ public function __construct(ArgumentResolverInterface $argument_resolver, Render ...@@ -84,10 +84,10 @@ public function __construct(ArgumentResolverInterface $argument_resolver, Render
/** /**
* Ensures bubbleable metadata from early rendering is not lost. * Ensures bubbleable metadata from early rendering is not lost.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent $event * @param \Symfony\Component\HttpKernel\Event\ControllerEvent $event
* The controller event. * The controller event.
*/ */
public function onController(FilterControllerEvent $event) { public function onController(ControllerEvent $event) {
$controller = $event->getController(); $controller = $event->getController();
// See \Symfony\Component\HttpKernel\HttpKernel::handleRaw(). // See \Symfony\Component\HttpKernel\HttpKernel::handleRaw().
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Form\EnforcedResponse; use Drupal\Core\Form\EnforcedResponse;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\Event\ExceptionEvent; use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
...@@ -26,7 +26,7 @@ public function onKernelException(ExceptionEvent $event) { ...@@ -26,7 +26,7 @@ public function onKernelException(ExceptionEvent $event) {
/** /**
* Unwraps an enforced response. * Unwraps an enforced response.
*/ */
public function onKernelResponse(FilterResponseEvent $event) { public function onKernelResponse(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
if ($response instanceof EnforcedResponse && $event->isMasterRequest()) { if ($response instanceof EnforcedResponse && $event->isMasterRequest()) {
$event->setResponse($response->getResponse()); $event->setResponse($response->getResponse());
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -91,10 +91,10 @@ public function __construct(LanguageManagerInterface $language_manager, ConfigFa ...@@ -91,10 +91,10 @@ public function __construct(LanguageManagerInterface $language_manager, ConfigFa
/** /**
* Sets extra headers on any responses, also subrequest ones. * Sets extra headers on any responses, also subrequest ones.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onAllResponds(FilterResponseEvent $event) { public function onAllResponds(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
// Always add the 'http_response' cache tag to be able to invalidate every // Always add the 'http_response' cache tag to be able to invalidate every
// response, for example after rebuilding routes. // response, for example after rebuilding routes.
...@@ -106,10 +106,10 @@ public function onAllResponds(FilterResponseEvent $event) { ...@@ -106,10 +106,10 @@ public function onAllResponds(FilterResponseEvent $event) {
/** /**
* Sets extra headers on successful responses. * Sets extra headers on successful responses.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(FilterResponseEvent $event) { public function onRespond(ResponseEvent $event) {
if (!$event->isMasterRequest()) { if (!$event->isMasterRequest()) {
return; return;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Render\HtmlResponse; use Drupal\Core\Render\HtmlResponse;
use Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface; use Drupal\Core\Render\Placeholder\PlaceholderStrategyInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -39,10 +39,10 @@ public function __construct(PlaceholderStrategyInterface $placeholder_strategy) ...@@ -39,10 +39,10 @@ public function __construct(PlaceholderStrategyInterface $placeholder_strategy)
/** /**
* Processes placeholders for HTML responses. * Processes placeholders for HTML responses.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(FilterResponseEvent $event) { public function onRespond(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
if (!$response instanceof HtmlResponse) { if (!$response instanceof HtmlResponse) {
return; return;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Render\HtmlResponse; use Drupal\Core\Render\HtmlResponse;
use Drupal\Core\Render\AttachmentsResponseProcessorInterface; use Drupal\Core\Render\AttachmentsResponseProcessorInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -33,10 +33,10 @@ public function __construct(AttachmentsResponseProcessorInterface $html_response ...@@ -33,10 +33,10 @@ public function __construct(AttachmentsResponseProcessorInterface $html_response
/** /**
* Processes attachments for HtmlResponse responses. * Processes attachments for HtmlResponse responses.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(FilterResponseEvent $event) { public function onRespond(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
if (!$response instanceof HtmlResponse) { if (!$response instanceof HtmlResponse) {
return; return;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -39,10 +39,10 @@ public function registerService($id) { ...@@ -39,10 +39,10 @@ public function registerService($id) {
/** /**
* Invoked by the terminate kernel event. * Invoked by the terminate kernel event.
* *
* @param \Symfony\Component\HttpKernel\Event\PostResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\TerminateEvent $event
* The event object. * The event object.
*/ */
public function onKernelTerminate(PostResponseEvent $event) { public function onKernelTerminate(TerminateEvent $event) {
foreach ($this->services as $id) { foreach ($this->services as $id) {
// Check if the service was initialized during this request, destruction // Check if the service was initialized during this request, destruction
// is not necessary if the service was not used. // is not necessary if the service was not used.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
use Drupal\Core\DependencyInjection\ClassResolverInterface; use Drupal\Core\DependencyInjection\ClassResolverInterface;
use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -72,10 +72,10 @@ public function __construct(ClassResolverInterface $class_resolver, RouteMatchIn ...@@ -72,10 +72,10 @@ public function __construct(ClassResolverInterface $class_resolver, RouteMatchIn
/** /**
* Sets a response given a (main content) render array. * Sets a response given a (main content) render array.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent $event * @param \Symfony\Component\HttpKernel\Event\ViewEvent $event
* The event to process. * The event to process.
*/ */
public function onViewRenderArray(GetResponseForControllerResultEvent $event) { public function onViewRenderArray(ViewEvent $event) {
$request = $event->getRequest(); $request = $event->getRequest();
$result = $event->getControllerResult(); $result = $event->getControllerResult();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -97,10 +97,10 @@ public function __construct(MaintenanceModeInterface $maintenance_mode, ConfigFa ...@@ -97,10 +97,10 @@ public function __construct(MaintenanceModeInterface $maintenance_mode, ConfigFa
/** /**
* Returns the site maintenance page if the site is offline. * Returns the site maintenance page if the site is offline.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The event to process. * The event to process.
*/ */
public function onKernelRequestMaintenance(GetResponseEvent $event) { public function onKernelRequestMaintenance(RequestEvent $event) {
$request = $event->getRequest(); $request = $event->getRequest();
$route_match = RouteMatch::createFromRequest($request); $route_match = RouteMatch::createFromRequest($request);
if ($this->maintenanceMode->applies($route_match)) { if ($this->maintenanceMode->applies($route_match)) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
use Symfony\Cmf\Component\Routing\RouteProviderInterface; use Symfony\Cmf\Component\Routing\RouteProviderInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\Route; use Symfony\Component\Routing\Route;
...@@ -37,10 +37,10 @@ public function __construct(RouteProviderInterface $route_provider) { ...@@ -37,10 +37,10 @@ public function __construct(RouteProviderInterface $route_provider) {
/** /**
* Tries to handle the options request. * Tries to handle the options request.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The request event. * The request event.
*/ */
public function onRequest(GetResponseEvent $event) { public function onRequest(RequestEvent $event) {
if ($event->getRequest()->isMethod('OPTIONS')) { if ($event->getRequest()->isMethod('OPTIONS')) {
$routes = $this->routeProvider->getRouteCollectionForRequest($event->getRequest()); $routes = $this->routeProvider->getRouteCollectionForRequest($event->getRequest());
// In case we don't have any routes, a 403 should be thrown by the normal // In case we don't have any routes, a 403 should be thrown by the normal
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface; use Symfony\Bridge\PsrHttpMessage\HttpFoundationFactoryInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
/** /**
...@@ -34,10 +34,10 @@ public function __construct(HttpFoundationFactoryInterface $http_foundation_fact ...@@ -34,10 +34,10 @@ public function __construct(HttpFoundationFactoryInterface $http_foundation_fact
/** /**
* Converts a PSR-7 response to a Symfony response. * Converts a PSR-7 response to a Symfony response.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent $event * @param \Symfony\Component\HttpKernel\Event\ViewEvent $event
* The Event to process. * The Event to process.
*/ */
public function onKernelView(GetResponseForControllerResultEvent $event) { public function onKernelView(ViewEvent $event) {
$controller_result = $event->getControllerResult(); $controller_result = $event->getControllerResult();
if ($controller_result instanceof ResponseInterface) { if ($controller_result instanceof ResponseInterface) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Drupal\Core\EventSubscriber; namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Cache\CacheableRedirectResponse; use Drupal\Core\Cache\CacheableRedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -15,10 +15,10 @@ class RedirectLeadingSlashesSubscriber implements EventSubscriberInterface { ...@@ -15,10 +15,10 @@ class RedirectLeadingSlashesSubscriber implements EventSubscriberInterface {
/** /**
* Redirects paths starting with multiple slashes to a single slash. * Redirects paths starting with multiple slashes to a single slash.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
* The GetResponseEvent to process. * The RequestEvent to process.
*/ */
public function redirect(GetResponseEvent $event) { public function redirect(RequestEvent $event) {
$request = $event->getRequest(); $request = $event->getRequest();
// Get the requested path minus the base path. // Get the requested path minus the base path.
$path = $request->getPathInfo(); $path = $request->getPathInfo();
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
use Drupal\Core\Utility\UnroutedUrlAssemblerInterface; use Drupal\Core\Utility\UnroutedUrlAssemblerInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent; use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
...@@ -41,10 +41,10 @@ public function __construct(UnroutedUrlAssemblerInterface $url_assembler, Reques ...@@ -41,10 +41,10 @@ public function __construct(UnroutedUrlAssemblerInterface $url_assembler, Reques
/** /**
* Allows manipulation of the response object when performing a redirect. * Allows manipulation of the response object when performing a redirect.
* *
* @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
* The Event to process. * The Event to process.
*/ */
public function checkRedirectUrl(FilterResponseEvent $event) { public function checkRedirectUrl(ResponseEvent $event) {
$response = $event->getResponse(); $response = $event->getResponse();
if ($response instanceof RedirectResponse) { if ($response instanceof RedirectResponse) {
$request = $event->getRequest(); $request = $event->getRequest();
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace Drupal\Core\EventSubscriber; namespace Drupal\Core\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\Event\ViewEvent;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException; use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
...@@ -15,10 +15,10 @@ class RenderArrayNonHtmlSubscriber implements EventSubscriberInterface { ...@@ -15,10 +15,10 @@ class RenderArrayNonHtmlSubscriber implements EventSubscriberInterface {
/** /**
* Throws an HTTP 406 error if client requested a non-HTML format. * Throws an HTTP 406 error if client requested a non-HTML format.
* *
* @param \Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent $event * @param \Symfony\Component\HttpKernel\Event\ViewEvent $event
* The event to process. * The event to process.
*/ */
public function onRespond(GetResponseForControllerResultEvent $event) { public function onRespond(ViewEvent $event) {
$request = $event->getRequest(); $request = $event->getRequest();
$result = $event->getControllerResult(); $result = $event->getControllerResult();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Extension\ModuleHandlerInterface;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\PostResponseEvent; use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/** /**
...@@ -35,10 +35,10 @@ public function __construct(ModuleHandlerInterface $module_handler) { ...@@ -35,10 +35,10 @@ public function __construct(ModuleHandlerInterface $module_handler) {
* removed/changed. Also, if possible, do more light-weight shutdowns on * removed/changed. Also, if possible, do more light-weight shutdowns on
* AJAX requests. * AJAX requests.
* *
* @param Symfony\Component\HttpKernel\Event\PostResponseEvent $event * @param Symfony\Component\HttpKernel\Event\TerminateEvent $event
* The Event to process. * The Event to process.
*/ */
public function onTerminate(PostResponseEvent $event) { public function onTerminate(TerminateEvent $event) {
$this->moduleHandler->writeCache(); $this->moduleHandler->writeCache();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment