Skip to content

Commit b15deb0

Browse files
committed
Rename master request to main request
1 parent 7873574 commit b15deb0

File tree

108 files changed

+416
-339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+416
-339
lines changed

UPGRADE-5.3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ FrameworkBundle
3636
* Deprecate the `framework.session.storage_id` configuration option, use the `framework.session.storage_factory_id` configuration option instead
3737
* Deprecate the `session` service and the `SessionInterface` alias, use the `\Symfony\Component\HttpFoundation\Request::getSession()` or the new `\Symfony\Component\HttpFoundation\RequestStack::getSession()` methods instead
3838
* Deprecate the `KernelTestCase::$container` property, use `KernelTestCase::getContainer()` instead
39+
* Rename the container parameter `profiler_listener.only_master_requests` to `profiler_listener.only_main_requests`
3940

4041
HttpFoundation
4142
--------------
4243

4344
* Deprecate the `NamespacedAttributeBag` class
45+
* Deprecate the `RequestStack::getMasterRequest()` method and add `getMainRequest()` as replacement
4446

4547
HttpKernel
4648
----------
@@ -49,6 +51,8 @@ HttpKernel
4951
* Deprecate `ArgumentMetadata::getAttribute()`, use `getAttributes()` instead
5052
* Mark the class `Symfony\Component\HttpKernel\EventListener\DebugHandlersListener` as internal
5153
* Deprecate returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()`
54+
* Deprecate `HttpKernelInterface::MASTER_REQUEST` and add `HttpKernelInterface::MAIN_REQUEST` as replacement
55+
* Deprecate `KernelEvent::isMasterRequest()` and add `isMainRequest()` as replacement
5256

5357
Messenger
5458
---------

UPGRADE-6.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ HttpFoundation
8989
`BinaryFileResponse::create()` methods (use `__construct()` instead)
9090
* Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `InvalidArgumentException`; wrap your filter in a closure instead.
9191
* Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead.
92+
* Rename `RequestStack::getMasterRequest()` to `getMainRequest()`
9293

9394
HttpKernel
9495
----------
@@ -98,6 +99,8 @@ HttpKernel
9899
* Make `WarmableInterface::warmUp()` return a list of classes or files to preload on PHP 7.4+
99100
* Remove support for `service:action` syntax to reference controllers. Use `serviceOrFqcn::method` instead.
100101
* Remove support for returning a `ContainerBuilder` from `KernelInterface::registerContainerConfiguration()`
102+
* Rename `HttpKernelInterface::MASTER_REQUEST` to `MAIN_REQUEST`
103+
* Rename `KernelEvent::isMasterRequest()` to `isMainRequest()`
101104

102105
Inflector
103106
---------

src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ChromePhpHandler extends BaseChromePhpHandler
3636
*/
3737
public function onKernelResponse(ResponseEvent $event)
3838
{
39-
if (!$event->isMasterRequest()) {
39+
if (!$event->isMainRequest()) {
4040
return;
4141
}
4242

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function isHandlerActivated(array $record): bool
6565
$isActivated
6666
&& isset($record['context']['exception'])
6767
&& $record['context']['exception'] instanceof HttpException
68-
&& ($request = $this->requestStack->getMasterRequest())
68+
&& ($request = $this->requestStack->getMainRequest())
6969
) {
7070
foreach ($this->exclusions as $exclusion) {
7171
if ($record['context']['exception']->getStatusCode() !== $exclusion['code']) {

src/Symfony/Bridge/Monolog/Handler/FingersCrossed/NotFoundActivationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function isHandlerActivated(array $record): bool
5757
&& isset($record['context']['exception'])
5858
&& $record['context']['exception'] instanceof HttpException
5959
&& 404 == $record['context']['exception']->getStatusCode()
60-
&& ($request = $this->requestStack->getMasterRequest())
60+
&& ($request = $this->requestStack->getMainRequest())
6161
) {
6262
return !preg_match($this->exclude, $request->getPathInfo());
6363
}

src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FirePHPHandler extends BaseFirePHPHandler
3636
*/
3737
public function onKernelResponse(ResponseEvent $event)
3838
{
39-
if (!$event->isMasterRequest()) {
39+
if (!$event->isMainRequest()) {
4040
return;
4141
}
4242

src/Symfony/Bridge/Monolog/Processor/RouteProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function reset()
5151

5252
public function addRouteData(RequestEvent $event)
5353
{
54-
if ($event->isMasterRequest()) {
54+
if ($event->isMainRequest()) {
5555
$this->reset();
5656
}
5757

src/Symfony/Bridge/Monolog/Processor/WebProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(array $extraFields = null)
3333

3434
public function onKernelRequest(RequestEvent $event)
3535
{
36-
if ($event->isMasterRequest()) {
36+
if ($event->isMainRequest()) {
3737
$this->serverData = $event->getRequest()->server->all();
3838
$this->serverData['REMOTE_ADDR'] = $event->getRequest()->getClientIp();
3939
}

src/Symfony/Bridge/Monolog/Tests/Processor/RouteProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ public function testProcessorDoesNothingWhenNoRequest()
123123
$this->assertEquals(['extra' => []], $record);
124124
}
125125

126-
private function getRequestEvent(Request $request, int $requestType = HttpKernelInterface::MASTER_REQUEST): RequestEvent
126+
private function getRequestEvent(Request $request, int $requestType = HttpKernelInterface::MAIN_REQUEST): RequestEvent
127127
{
128128
return new RequestEvent($this->createMock(HttpKernelInterface::class), $request, $requestType);
129129
}
130130

131131
private function getFinishRequestEvent(Request $request): FinishRequestEvent
132132
{
133-
return new FinishRequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST);
133+
return new FinishRequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST);
134134
}
135135

136136
private function mockEmptyRequest(): Request

src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function createRequestEvent(array $additionalServerParameters = []): arr
8989
$request->server->replace($server);
9090
$request->headers->replace($server);
9191

92-
$event = new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MASTER_REQUEST);
92+
$event = new RequestEvent($this->createMock(HttpKernelInterface::class), $request, HttpKernelInterface::MAIN_REQUEST);
9393

9494
return [$event, $server];
9595
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy