Skip to content

Commit 7fd2127

Browse files
committed
Remove HttpKernelInterface::MASTER_REQUEST references
1 parent 892f208 commit 7fd2127

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

phpstan-baseline.neon

-18
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,3 @@ parameters:
4040
count: 1
4141
path: tests/DependencyInjection/ConfigurationTest.php
4242

43-
-
44-
message: """
45-
#^Fetching deprecated class constant MASTER_REQUEST of class Symfony\\\\Component\\\\HttpKernel\\\\HttpKernelInterface\\:
46-
since symfony/http\\-kernel 5\\.3, use MAIN_REQUEST instead\\.
47-
To ease the migration, this constant won't be removed until Symfony 7\\.0\\.$#
48-
"""
49-
count: 1
50-
path: tests/Listener/ListenerTestCase.php
51-
52-
-
53-
message: """
54-
#^Fetching deprecated class constant MASTER_REQUEST of class Symfony\\\\Component\\\\HttpKernel\\\\HttpKernelInterface\\:
55-
since symfony/http\\-kernel 5\\.3, use MAIN_REQUEST instead\\.
56-
To ease the migration, this constant won't be removed until Symfony 7\\.0\\.$#
57-
"""
58-
count: 1
59-
path: tests/Twig/IntegrationTest.php
60-

tests/Listener/ListenerTestCase.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ private function getRequestType(bool $mainRequest): int
7878
return HttpKernelInterface::SUB_REQUEST;
7979
}
8080

81-
return \defined(HttpKernelInterface::class.'::MAIN_REQUEST')
82-
? HttpKernelInterface::MAIN_REQUEST
83-
: HttpKernelInterface::MASTER_REQUEST
84-
;
81+
return HttpKernelInterface::MAIN_REQUEST;
8582
}
8683
}

tests/Twig/IntegrationTest.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testItWorksDynamically(): void
6464
$listener->onKernelRequest(new RequestEvent(
6565
$this->createStub(HttpKernelInterface::class),
6666
Request::create('/'),
67-
$this->getMasterRequestType()
67+
HttpKernelInterface::MAIN_REQUEST
6868
));
6969

7070
$this->assertSame('<script type="text/javascript">console.log(\'123456\');</script>
@@ -113,7 +113,7 @@ public function testItWorksStatically(): void
113113
$listener->onKernelRequest(new RequestEvent(
114114
$this->createStub(HttpKernelInterface::class),
115115
Request::create('/'),
116-
$this->getMasterRequestType()
116+
HttpKernelInterface::MAIN_REQUEST
117117
));
118118

119119
$this->assertSame('<script type="text/javascript">console.log(\'Hello\');</script>
@@ -127,12 +127,4 @@ public function testItWorksStatically(): void
127127

128128
$this->assertSame(['script-src' => ['sha-script'], 'style-src' => ['sha-style']], $getSha($listener));
129129
}
130-
131-
private function getMasterRequestType(): int
132-
{
133-
return \defined(HttpKernelInterface::class.'::MAIN_REQUEST')
134-
? HttpKernelInterface::MAIN_REQUEST
135-
: HttpKernelInterface::MASTER_REQUEST
136-
;
137-
}
138130
}

0 commit comments

Comments
 (0)