Skip to content

Commit a810772

Browse files
bug #47836 [HttpClient] TraceableHttpClient: increase decorator's priority (adpeyre)
This PR was submitted for the 4.4 branch but it was merged into the 5.4 branch instead. Discussion ---------- [HttpClient] TraceableHttpClient: increase decorator's priority | Q | A | ------------- | --- | Branch? | 4.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | <!-- required for new features --> Hello, When I decorate my http client, all requests are not collected and visible in the profiler because of the decorator's priority of TraceableHttpClient (sub request for example). I think it should be increased. I fixed an arbitrary value of 100. What do you think about that ? Ty Commits ------- a4e3b93 TraceableHttpClient: increase decorator's priority
2 parents e0bd8e1 + a4e3b93 commit a810772

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/HttpClient/DependencyInjection/HttpClientPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function process(ContainerBuilder $container)
4343
$container->register('.debug.'.$id, TraceableHttpClient::class)
4444
->setArguments([new Reference('.debug.'.$id.'.inner'), new Reference('debug.stopwatch', ContainerInterface::IGNORE_ON_INVALID_REFERENCE)])
4545
->addTag('kernel.reset', ['method' => 'reset'])
46-
->setDecoratedService($id);
46+
->setDecoratedService($id, null, 5);
4747
$container->getDefinition('data_collector.http_client')
4848
->addMethodCall('registerClient', [$id, new Reference('.debug.'.$id)]);
4949
}

src/Symfony/Component/HttpClient/Tests/DependencyInjection/HttpClientPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testItDecoratesHttpClientWithTraceableHttpClient()
3838
$sut->process($container);
3939
$this->assertTrue($container->hasDefinition('.debug.foo'));
4040
$this->assertSame(TraceableHttpClient::class, $container->getDefinition('.debug.foo')->getClass());
41-
$this->assertSame(['foo', null, 0], $container->getDefinition('.debug.foo')->getDecoratedService());
41+
$this->assertSame(['foo', null, 5], $container->getDefinition('.debug.foo')->getDecoratedService());
4242
}
4343

4444
public function testItRegistersDebugHttpClientToCollector()

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