8000 minor #46945 [HttpKernel] Declare properties used by CacheAttributeLi… · symfony/symfony@4b4f334 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4b4f334

Browse files
committed
minor #46945 [HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly (derrabus)
This PR was merged into the 6.2 branch. Discussion ---------- [HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | N/A | License | MIT | Doc PR | N/A A test case introduced by #46880 triggers deprecation notices on PHP 8.2 because none of the properties used is declared. This PR fixes the build by adding explicit property declarations. Commits ------- f0d0799 [HttpKernel] Declare properties used by CacheAttributeListenerTest explicitly
2 parents be958d4 + f0d0799 commit 4b4f334

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Symfony/Component/HttpKernel/Tests/EventListener/CacheAttributeListenerTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424

2525
class CacheAttributeListenerTest extends TestCase
2626
{
27+
private CacheAttributeListener $listener;
28+
private Response $response;
29+
private Cache $cache;
30+
private Request $request;
31+
private ResponseEvent $event;
32+
2733
protected function setUp(): void
2834
{
2935
$this->listener = new CacheAttributeListener();
@@ -294,12 +300,12 @@ public function testAttribute()
294300
$this->assertSame(CacheAttributeController::CLASS_SMAXAGE, $response->getMaxAge());
295301
}
296302

297-
private function createRequest(Cache $cache = null)
303+
private function c 6B18 reateRequest(Cache $cache): Request
298304
{
299305
return new Request([], [], ['_cache' => [$cache]]);
300306
}
301307

302-
private function createEventMock(Request $request, Response $response)
308+
private function createEventMock(Request $request, Response $response): ResponseEvent
303309
{
304310
return new ResponseEvent($this->getKernel(), $request, HttpKernelInterface::MAIN_REQUEST, $response);
305311
}

0 commit comments

Comments
 (0)
0