Loading modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php +4 −4 Original line number Diff line number Diff line Loading @@ -8,10 +8,10 @@ use Drupal\Core\Path\PathMatcherInterface; use Drupal\redirect_404\RedirectNotFoundStorageInterface; use Drupal\Core\Path\CurrentPathStack; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ExceptionEvent; /** * An EventSubscriber that listens to redirect 404 errors. Loading Loading @@ -96,12 +96,12 @@ class Redirect404Subscriber implements EventSubscriberInterface { /** * Logs an exception of 404 Redirect errors. * * @param GetResponseForExceptionEvent $event * @param ExceptionEvent $event * Is given by the event dispatcher. */ public function onKernelException(GetResponseForExceptionEvent $event) { public function onKernelException(ExceptionEvent $event) { // Only log page not found (404) errors. if ($event->getException() instanceof NotFoundHttpException) { if ($event->getThrowable() instanceof NotFoundHttpException) { $path = $this->currentPath->getPath(); // Ignore paths specified in the redirect settings. Loading modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php +5 −5 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ use Drupal\Core\Path\PathMatcherInterface; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Url; use Drupal\redirect\RedirectChecker; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** Loading Loading @@ -62,10 +62,10 @@ class DomainRedirectRequestSubscriber implements EventSubscriberInterface { /** * Handles the domain redirect if any found. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event to process. */ public function onKernelRequestCheckDomainRedirect(GetResponseEvent $event) { public function onKernelRequestCheckDomainRedirect(RequestEvent $event) { $request = clone $event->getRequest(); if (!$this->redirectChecker->canRedirect($request)) { Loading Loading @@ -111,12 +111,12 @@ class DomainRedirectRequestSubscriber implements EventSubscriberInterface { /** * Prior to set the response it check if we can redirect. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event object. * @param \Drupal\Core\Url $url * The Url where we want to redirect. */ protected function setResponse(GetResponseEvent $event, Url $url) { protected function setResponse(RequestEvent $event, Url $url) { $request = $event->getRequest(); parse_str($request->getQueryString(), $query); Loading modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use Drupal\redirect_domain\EventSubscriber\DomainRedirectRequestSubscriber; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; /** Loading Loading @@ -128,7 +128,7 @@ class DomainRedirectRequestSubscriberTest extends UnitTestCase { * @param $query_string * The query string in the url. * * @return GetResponseEvent * @return RequestEvent * The response for the request. */ protected function getGetResponseEventStub($path_info, $query_string) { Loading @@ -136,7 +136,7 @@ class DomainRedirectRequestSubscriberTest extends UnitTestCase { $http_kernel = $this->getMockBuilder(HttpKernelInterface::class) ->getMock(); return new GetResponseEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST); return new RequestEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST); } /** Loading src/EventSubscriber/RedirectRequestSubscriber.php +5 −5 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ use Drupal\redirect\Exception\RedirectLoopException; use Drupal\redirect\RedirectChecker; use Drupal\redirect\RedirectRepository; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Routing\RequestContext; Loading Loading @@ -105,10 +105,10 @@ class RedirectRequestSubscriber implements EventSubscriberInterface { /** * Handles the redirect if any found. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event to process. */ public function onKernelRequestCheckRedirect(GetResponseEvent $event) { public function onKernelRequestCheckRedirect(RequestEvent $event) { // Get a clone of the request. During inbound processing the request // can be altered. Allowing this here can lead to unexpected behavior. // For example the path_processor.files inbound processor provided by Loading Loading @@ -176,12 +176,12 @@ class RedirectRequestSubscriber implements EventSubscriberInterface { /** * Prior to set the response it check if we can redirect. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event object. * @param \Drupal\Core\Url $url * The Url where we want to redirect. */ protected function setResponse(GetResponseEvent $event, Url $url) { protected function setResponse(RequestEvent $event, Url $url) { $request = $event->getRequest(); $this->context->fromRequest($request); Loading src/EventSubscriber/RouteNormalizerRequestSubscriber.php +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Core\Routing\RequestHelper; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\redirect\RedirectChecker; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; Loading Loading @@ -80,10 +81,10 @@ class RouteNormalizerRequestSubscriber implements EventSubscriberInterface { * page. * - Requested path has an alias: redirect to alias. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The Event to process. */ public function onKernelRequestRedirect(GetResponseEvent $event) { public function onKernelRequestRedirect(RequestEvent $event) { if (!$this->config->get('route_normalizer_enabled') || !$event->isMasterRequest()) { return; Loading Loading
modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php +4 −4 Original line number Diff line number Diff line Loading @@ -8,10 +8,10 @@ use Drupal\Core\Path\PathMatcherInterface; use Drupal\redirect_404\RedirectNotFoundStorageInterface; use Drupal\Core\Path\CurrentPathStack; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpKernel\Event\ExceptionEvent; /** * An EventSubscriber that listens to redirect 404 errors. Loading Loading @@ -96,12 +96,12 @@ class Redirect404Subscriber implements EventSubscriberInterface { /** * Logs an exception of 404 Redirect errors. * * @param GetResponseForExceptionEvent $event * @param ExceptionEvent $event * Is given by the event dispatcher. */ public function onKernelException(GetResponseForExceptionEvent $event) { public function onKernelException(ExceptionEvent $event) { // Only log page not found (404) errors. if ($event->getException() instanceof NotFoundHttpException) { if ($event->getThrowable() instanceof NotFoundHttpException) { $path = $this->currentPath->getPath(); // Ignore paths specified in the redirect settings. Loading
modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php +5 −5 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ use Drupal\Core\Path\PathMatcherInterface; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Url; use Drupal\redirect\RedirectChecker; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** Loading Loading @@ -62,10 +62,10 @@ class DomainRedirectRequestSubscriber implements EventSubscriberInterface { /** * Handles the domain redirect if any found. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event to process. */ public function onKernelRequestCheckDomainRedirect(GetResponseEvent $event) { public function onKernelRequestCheckDomainRedirect(RequestEvent $event) { $request = clone $event->getRequest(); if (!$this->redirectChecker->canRedirect($request)) { Loading Loading @@ -111,12 +111,12 @@ class DomainRedirectRequestSubscriber implements EventSubscriberInterface { /** * Prior to set the response it check if we can redirect. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event object. * @param \Drupal\Core\Url $url * The Url where we want to redirect. */ protected function setResponse(GetResponseEvent $event, Url $url) { protected function setResponse(RequestEvent $event, Url $url) { $request = $event->getRequest(); parse_str($request->getQueryString(), $query); Loading
modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php +3 −3 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ use Drupal\redirect_domain\EventSubscriber\DomainRedirectRequestSubscriber; use Drupal\Tests\UnitTestCase; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; /** Loading Loading @@ -128,7 +128,7 @@ class DomainRedirectRequestSubscriberTest extends UnitTestCase { * @param $query_string * The query string in the url. * * @return GetResponseEvent * @return RequestEvent * The response for the request. */ protected function getGetResponseEventStub($path_info, $query_string) { Loading @@ -136,7 +136,7 @@ class DomainRedirectRequestSubscriberTest extends UnitTestCase { $http_kernel = $this->getMockBuilder(HttpKernelInterface::class) ->getMock(); return new GetResponseEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST); return new RequestEvent($http_kernel, $request, HttpKernelInterface::MASTER_REQUEST); } /** Loading
src/EventSubscriber/RedirectRequestSubscriber.php +5 −5 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ use Drupal\redirect\Exception\RedirectLoopException; use Drupal\redirect\RedirectChecker; use Drupal\redirect\RedirectRepository; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Routing\RequestContext; Loading Loading @@ -105,10 +105,10 @@ class RedirectRequestSubscriber implements EventSubscriberInterface { /** * Handles the redirect if any found. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event to process. */ public function onKernelRequestCheckRedirect(GetResponseEvent $event) { public function onKernelRequestCheckRedirect(RequestEvent $event) { // Get a clone of the request. During inbound processing the request // can be altered. Allowing this here can lead to unexpected behavior. // For example the path_processor.files inbound processor provided by Loading Loading @@ -176,12 +176,12 @@ class RedirectRequestSubscriber implements EventSubscriberInterface { /** * Prior to set the response it check if we can redirect. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The event object. * @param \Drupal\Core\Url $url * The Url where we want to redirect. */ protected function setResponse(GetResponseEvent $event, Url $url) { protected function setResponse(RequestEvent $event, Url $url) { $request = $event->getRequest(); $this->context->fromRequest($request); Loading
src/EventSubscriber/RouteNormalizerRequestSubscriber.php +3 −2 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use Drupal\Core\Routing\RequestHelper; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Routing\UrlGeneratorInterface; use Drupal\redirect\RedirectChecker; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; Loading Loading @@ -80,10 +81,10 @@ class RouteNormalizerRequestSubscriber implements EventSubscriberInterface { * page. * - Requested path has an alias: redirect to alias. * * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event * The Event to process. */ public function onKernelRequestRedirect(GetResponseEvent $event) { public function onKernelRequestRedirect(RequestEvent $event) { if (!$this->config->get('route_normalizer_enabled') || !$event->isMasterRequest()) { return; Loading