From 0a165fbe5138e8a4d8a88dddf2ebed0e8f034f4b Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Fri, 19 Jul 2024 16:46:08 +0200 Subject: [PATCH 1/3] [Rector] Applied all Symfony 5.x rectors to the production codebase Applied rules: * AddReturnTypeDeclarationRector * RenameClassConstFetchRector * ResponseStatusCodeRector --- src/bundle/AppCache.php | 2 +- src/bundle/Controller/InvalidateTokenController.php | 4 ++-- src/bundle/DependencyInjection/Configuration.php | 2 +- src/bundle/DependencyInjection/IbexaHttpCacheExtension.php | 2 +- src/bundle/IbexaHttpCacheBundle.php | 2 +- .../EventListener/ConditionallyRemoveVaryHeaderListener.php | 2 +- .../EventSubscriber/AddContentLanguageHeaderSubscriber.php | 4 ++-- src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php | 2 +- src/lib/EventSubscriber/HttpCacheResponseSubscriber.php | 2 +- src/lib/EventSubscriber/RestKernelViewSubscriber.php | 2 +- .../EventSubscriber/UserContextSiteAccessMatchSubscriber.php | 2 +- src/lib/EventSubscriber/UserContextSubscriber.php | 2 +- src/lib/EventSubscriber/XLocationIdResponseSubscriber.php | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/bundle/AppCache.php b/src/bundle/AppCache.php index e55e158..2997342 100644 --- a/src/bundle/AppCache.php +++ b/src/bundle/AppCache.php @@ -58,7 +58,7 @@ protected function createStore() /** * {@inheritdoc} */ - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) + public function handle(Request $request, $type = HttpKernelInterface::MAIN_REQUEST, $catch = true) { $response = $this->baseHandle($request, $type, $catch); diff --git a/src/bundle/Controller/InvalidateTokenController.php b/src/bundle/Controller/InvalidateTokenController.php index 587277e..6cf67e2 100644 --- a/src/bundle/Controller/InvalidateTokenController.php +++ b/src/bundle/Controller/InvalidateTokenController.php @@ -56,14 +56,14 @@ public function tokenAction(Request $request) $response = new Response(); if (!$request->isFromTrustedProxy()) { - $response->setStatusCode('401', 'Unauthorized'); + $response->setStatusCode(Response::HTTP_UNAUTHORIZED, 'Unauthorized'); return $response; } // Important to keep this condition, as .vcl rely on this to prevent everyone from being able to fetch the token. if ($request->headers->get('accept') !== 'application/vnd.ezplatform.invalidate-token') { - $response->setStatusCode('400', 'Bad request'); + $response->setStatusCode(Response::HTTP_BAD_REQUEST, 'Bad request'); return $response; } diff --git a/src/bundle/DependencyInjection/Configuration.php b/src/bundle/DependencyInjection/Configuration.php index 14ec118..b92b358 100644 --- a/src/bundle/DependencyInjection/Configuration.php +++ b/src/bundle/DependencyInjection/Configuration.php @@ -20,7 +20,7 @@ class Configuration implements ConfigurationInterface /** * {@inheritdoc} */ - public function getConfigTreeBuilder() + public function getConfigTreeBuilder(): TreeBuilder { return new TreeBuilder('ibexa_http_cache'); } diff --git a/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php b/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php index f7bba60..7b4daed 100644 --- a/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php +++ b/src/bundle/DependencyInjection/IbexaHttpCacheExtension.php @@ -24,7 +24,7 @@ class IbexaHttpCacheExtension extends Extension implements PrependExtensionInter */ private $extraConfigParsers = []; - public function getAlias() + public function getAlias(): string { return 'ibexa_http_cache'; } diff --git a/src/bundle/IbexaHttpCacheBundle.php b/src/bundle/IbexaHttpCacheBundle.php index 94bb4f2..cf16f3e 100644 --- a/src/bundle/IbexaHttpCacheBundle.php +++ b/src/bundle/IbexaHttpCacheBundle.php @@ -36,7 +36,7 @@ public function getContainerExtensionClass() return IbexaHttpCacheExtension::class; } - public function getContainerExtension() + public function getContainerExtension(): ?ExtensionInterface { if (null === $this->extension) { $extension = $this->createContainerExtension(); diff --git a/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php b/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php index d8853a7..08feb32 100644 --- a/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php +++ b/src/lib/EventListener/ConditionallyRemoveVaryHeaderListener.php @@ -72,7 +72,7 @@ public function onKernelResponse(ResponseEvent $event) /** * {@inheritdoc} */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::RESPONSE => 'onKernelResponse', diff --git a/src/lib/EventSubscriber/AddContentLanguageHeaderSubscriber.php b/src/lib/EventSubscriber/AddContentLanguageHeaderSubscriber.php index 0f25657..e7d7359 100644 --- a/src/lib/EventSubscriber/AddContentLanguageHeaderSubscriber.php +++ b/src/lib/EventSubscriber/AddContentLanguageHeaderSubscriber.php @@ -29,7 +29,7 @@ public function __construct(bool $isTranslationAware) public function onKernelResponse(ResponseEvent $event) { - if (!$this->isTranslationAware || HttpKernelInterface::MASTER_REQUEST != $event->getRequestType()) { + if (!$this->isTranslationAware || HttpKernelInterface::MAIN_REQUEST != $event->getRequestType()) { return; } @@ -48,7 +48,7 @@ public function onKernelResponse(ResponseEvent $event) /** * {@inheritdoc} */ - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::RESPONSE => 'onKernelResponse', diff --git a/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php b/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php index 4800663..0f20e25 100644 --- a/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php +++ b/src/lib/EventSubscriber/HiddenLocationExceptionSubscriber.php @@ -32,7 +32,7 @@ public function __construct(LocationTagger $locationTagger, ContentInfoTagger $c $this->contentInfoTagger = $contentInfoTagger; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::EXCEPTION => ['tagHiddenLocationExceptionResponse', 10]]; } diff --git a/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php b/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php index 5c687a9..0887bc8 100644 --- a/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php +++ b/src/lib/EventSubscriber/HttpCacheResponseSubscriber.php @@ -35,7 +35,7 @@ public function __construct(ResponseCacheConfigurator $responseConfigurator, Res $this->dispatcherTagger = $dispatcherTagger; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::RESPONSE => ['configureCache', 10]]; } diff --git a/src/lib/EventSubscriber/RestKernelViewSubscriber.php b/src/lib/EventSubscriber/RestKernelViewSubscriber.php index d5bf3e5..2dbb32e 100644 --- a/src/lib/EventSubscriber/RestKernelViewSubscriber.php +++ b/src/lib/EventSubscriber/RestKernelViewSubscriber.php @@ -38,7 +38,7 @@ public function __construct(ResponseTagger $tagHandler) $this->tagHandler = $tagHandler; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::VIEW => ['tagUIRestResult', 10]]; } diff --git a/src/lib/EventSubscriber/UserContextSiteAccessMatchSubscriber.php b/src/lib/EventSubscriber/UserContextSiteAccessMatchSubscriber.php index 6f9d05d..26455aa 100644 --- a/src/lib/EventSubscriber/UserContextSiteAccessMatchSubscriber.php +++ b/src/lib/EventSubscriber/UserContextSiteAccessMatchSubscriber.php @@ -30,7 +30,7 @@ public function __construct( $this->userContextRequestMatcher = $userContextRequestMatcher; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ // Should take place just after FragmentListener (priority 48) in order to get rebuilt request attributes in case of subrequest diff --git a/src/lib/EventSubscriber/UserContextSubscriber.php b/src/lib/EventSubscriber/UserContextSubscriber.php index 2d5c832..4857a8b 100644 --- a/src/lib/EventSubscriber/UserContextSubscriber.php +++ b/src/lib/EventSubscriber/UserContextSubscriber.php @@ -36,7 +36,7 @@ public function __construct( $this->tagHeader = $tagHeader; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::RESPONSE => ['tagUserContext', 10]]; } diff --git a/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php b/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php index 5b4e013..ef58785 100644 --- a/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php +++ b/src/lib/EventSubscriber/XLocationIdResponseSubscriber.php @@ -39,7 +39,7 @@ public function __construct(ResponseTagger $responseTagger, Repository $reposito $this->repository = $repository; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [KernelEvents::RESPONSE => ['rewriteCacheHeader', 10]]; } From 2d4fac6e41007a2625ee62c1d7f1d6d26658ffc2 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Fri, 19 Jul 2024 16:46:09 +0200 Subject: [PATCH 2/3] [Rector][Tests] Applied all Symfony 5.x rectors to the test codebase Applied rules: * ResponseStatusCodeRector --- .../EventListener/ConditionallyRemoveVaryHeaderListenerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php b/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php index ed435e1..d70f8b6 100644 --- a/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php +++ b/tests/bundle/EventListener/ConditionallyRemoveVaryHeaderListenerTest.php @@ -81,7 +81,7 @@ public function testOnKernelResponse(array $varyHeaders, array $expectedVaryHead $request->method('get') ->willReturn('testroute1'); - $response = new Response('test content', 200, ['vary' => $varyHeaders]); + $response = new Response('test content', Response::HTTP_OK, ['vary' => $varyHeaders]); $kernel = $this->createMock(HttpKernelInterface::class); $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); From 3688dd4950d62745bfed09526481541c5a496052 Mon Sep 17 00:00:00 2001 From: Andrew Longosz Date: Fri, 19 Jul 2024 16:46:11 +0200 Subject: [PATCH 3/3] [Rector][Spec] Applied all Symfony 5.x rectors to the test codebase Applied rules: * RenameClassConstFetchRector --- .../HiddenLocationExceptionSubscriberSpec.php | 13 +++--- .../HttpCacheResponseSubscriberSpec.php | 11 +++-- .../RestKernelViewSubscriberSpec.php | 46 +++++++++---------- .../UserContextSubscriberSpec.php | 18 +++++--- .../XLocationIdResponseSubscriberSpec.php | 14 +++--- 5 files changed, 55 insertions(+), 47 deletions(-) diff --git a/spec/EventSubscriber/HiddenLocationExceptionSubscriberSpec.php b/spec/EventSubscriber/HiddenLocationExceptionSubscriberSpec.php index d80a803..c58e2a1 100644 --- a/spec/EventSubscriber/HiddenLocationExceptionSubscriberSpec.php +++ b/spec/EventSubscriber/HiddenLocationExceptionSubscriberSpec.php @@ -4,17 +4,18 @@ * @copyright Copyright (C) Ibexa AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributed with this source code. */ + namespace spec\Ibexa\HttpCache\EventSubscriber; +use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; +use Ibexa\Contracts\Core\Repository\Values\Content\Location; +use Ibexa\Core\MVC\Exception\HiddenLocationException; use Ibexa\HttpCache\ResponseTagger\Value\ContentInfoTagger; use Ibexa\HttpCache\ResponseTagger\Value\LocationTagger; use PhpSpec\ObjectBehavior; +use Prophecy\Argument; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\ExceptionEvent; -use Ibexa\Contracts\Core\Repository\Values\Content\Location; -use Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo; -use Ibexa\Core\MVC\Exception\HiddenLocationException; -use Prophecy\Argument; use Symfony\Component\HttpKernel\HttpKernelInterface; class HiddenLocationExceptionSubscriberSpec extends ObjectBehavior @@ -43,7 +44,7 @@ public function it_tags_on_hidden_location_exception( $event = new ExceptionEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $exception->getWrappedObject() ); @@ -64,7 +65,7 @@ public function it_does_not_tag_on_other_exceptions( $event = new ExceptionEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $exception->getWrappedObject() ); diff --git a/spec/EventSubscriber/HttpCacheResponseSubscriberSpec.php b/spec/EventSubscriber/HttpCacheResponseSubscriberSpec.php index 55b0ee2..d91e3b3 100644 --- a/spec/EventSubscriber/HttpCacheResponseSubscriberSpec.php +++ b/spec/EventSubscriber/HttpCacheResponseSubscriberSpec.php @@ -1,20 +1,21 @@ getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -67,7 +68,7 @@ public function it_does_not_enable_cache_if_it_is_disabled_in_the_view( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -91,7 +92,7 @@ public function it_enables_cache( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); diff --git a/spec/EventSubscriber/RestKernelViewSubscriberSpec.php b/spec/EventSubscriber/RestKernelViewSubscriberSpec.php index f1e024f..471cf5f 100644 --- a/spec/EventSubscriber/RestKernelViewSubscriberSpec.php +++ b/spec/EventSubscriber/RestKernelViewSubscriberSpec.php @@ -1,28 +1,27 @@ getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -69,7 +68,7 @@ public function it_does_nothing_on_non_rest_requests( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -77,7 +76,7 @@ public function it_does_nothing_on_non_rest_requests( } /** - * Section + * Section. */ public function it_writes_tags_on_section( HttpKernelInterface $kernel, @@ -96,7 +95,7 @@ public function it_writes_tags_on_section( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -104,7 +103,7 @@ public function it_writes_tags_on_section( } /** - * ContentType + * ContentType. */ public function it_does_nothing_on_content_type_draft( HttpKernelInterface $kernel, @@ -124,7 +123,7 @@ public function it_does_nothing_on_content_type_draft( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -148,7 +147,7 @@ public function it_writes_tags_on_content_type_defined( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -156,7 +155,7 @@ public function it_writes_tags_on_content_type_defined( } /** - * RestContentType + * RestContentType. */ public function it_does_nothing_on_rest_content_type_draft( HttpKernelInterface $kernel, @@ -177,7 +176,7 @@ public function it_does_nothing_on_rest_content_type_draft( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -186,7 +185,8 @@ public function it_does_nothing_on_rest_content_type_draft( public function it_writes_tags_on_rest_content_type_defined( HttpKernelInterface $kernel, - Request $request, ParameterBag $attributes, + Request $request, + ParameterBag $attributes, RestContentType $restValue, ContentType $contentType, ResponseTagger $tagHandler @@ -202,7 +202,7 @@ public function it_writes_tags_on_rest_content_type_defined( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -210,7 +210,7 @@ public function it_writes_tags_on_rest_content_type_defined( } /** - * ContentTypeGroupRefList + * ContentTypeGroupRefList. */ public function it_does_nothing_on_rest_content_type_group_ref_draft( HttpKernelInterface $kernel, @@ -233,7 +233,7 @@ public function it_does_nothing_on_rest_content_type_group_ref_draft( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -263,7 +263,7 @@ public function it_writes_tags_on_rest_content_type_group_ref_defined( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -271,7 +271,7 @@ public function it_writes_tags_on_rest_content_type_group_ref_defined( } /** - * ContentTypeGroupList + * ContentTypeGroupList. */ public function it_writes_tags_on_rest_content_type_group_list( HttpKernelInterface $kernel, @@ -292,7 +292,7 @@ public function it_writes_tags_on_rest_content_type_group_list( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); @@ -300,7 +300,7 @@ public function it_writes_tags_on_rest_content_type_group_list( } /** - * VersionList + * VersionList. */ public function it_writes_tags_on_rest_version_list( HttpKernelInterface $kernel, @@ -323,7 +323,7 @@ public function it_writes_tags_on_rest_version_list( $event = new ViewEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $restValue->getWrappedObject() ); diff --git a/spec/EventSubscriber/UserContextSubscriberSpec.php b/spec/EventSubscriber/UserContextSubscriberSpec.php index 3a4de2b..dfc8d17 100644 --- a/spec/EventSubscriber/UserContextSubscriberSpec.php +++ b/spec/EventSubscriber/UserContextSubscriberSpec.php @@ -1,5 +1,10 @@ beConstructedWith($prefixService, 'xkey'); } - function it_is_initializable() + public function it_is_initializable() { $this->shouldHaveType(UserContextSubscriber::class); } @@ -46,7 +50,7 @@ public function it_does_nothing_on_uncachable_methods( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -68,7 +72,7 @@ public function it_does_nothing_on_wrong_content_type( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -90,7 +94,7 @@ public function it_does_nothing_on_empty_ttl( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -114,7 +118,7 @@ public function it_tags_response_with_no_prefix( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -138,7 +142,7 @@ public function it_tags_response_with_a_prefix( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); diff --git a/spec/EventSubscriber/XLocationIdResponseSubscriberSpec.php b/spec/EventSubscriber/XLocationIdResponseSubscriberSpec.php index 8b41701..102d42a 100644 --- a/spec/EventSubscriber/XLocationIdResponseSubscriberSpec.php +++ b/spec/EventSubscriber/XLocationIdResponseSubscriberSpec.php @@ -1,15 +1,17 @@ getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -66,7 +68,7 @@ public function it_rewrite_header_with_location_info( 'id' => 123, 'parentLocationId' => 2, 'pathString' => '/1/2/123/', - 'contentInfo' => new ContentInfo(['id' => 101, 'contentTypeId' => 3, 'mainLocationId' => 120]) + 'contentInfo' => new ContentInfo(['id' => 101, 'contentTypeId' => 3, 'mainLocationId' => 120]), ]) ); @@ -85,7 +87,7 @@ public function it_rewrite_header_with_location_info( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -113,7 +115,7 @@ public function it_rewrite_header_on_not_found_location( $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() ); @@ -141,7 +143,7 @@ public function it_rewrite_header_also_in_unofficial_plural_form_and_merges_exis $event = new ResponseEvent( $kernel->getWrappedObject(), $request->getWrappedObject(), - HttpKernelInterface::MASTER_REQUEST, + HttpKernelInterface::MAIN_REQUEST, $response->getWrappedObject() );