diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/CacheAttributeListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/CacheAttributeListenerTest.php index f49d5b4cc7511..239d8c762437c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/CacheAttributeListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/CacheAttributeListenerTest.php @@ -24,6 +24,12 @@ class CacheAttributeListenerTest extends TestCase { + private CacheAttributeListener $listener; + private Response $response; + private Cache $cache; + private Request $request; + private ResponseEvent $event; + protected function setUp(): void { $this->listener = new CacheAttributeListener(); @@ -294,12 +300,12 @@ public function testAttribute() $this->assertSame(CacheAttributeController::CLASS_SMAXAGE, $response->getMaxAge()); } - private function createRequest(Cache $cache = null) + private function createRequest(Cache $cache): Request { return new Request([], [], ['_cache' => [$cache]]); } - private function createEventMock(Request $request, Response $response) + private function createEventMock(Request $request, Response $response): ResponseEvent { return new ResponseEvent($this->getKernel(), $request, HttpKernelInterface::MAIN_REQUEST, $response); }