Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bec8ee7

Browse files
committed
Review feedback
1 parent 438a864 commit bec8ee7

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

UPGRADE-6.3.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ FrameworkBundle
5656
---------------
5757

5858
* Deprecate the `notifier.logger_notification_listener` service, use the `notifier.notification_logger_listener` service instead
59-
60-
HttpClient
61-
----------
62-
63-
* Deprecate the `Http\Client\HttpClient` service, use the `Http\Client\HttpAsyncClient` service for method `::sendAsyncRequest` and `psr\Http\Client\ClientInterface` for `::sendRequest` instead
59+
* Deprecate the `Http\Client\HttpClient` service, use `Psr\Http\Client\ClientInterface` instead
6460

6561
HttpFoundation
6662
--------------

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ CHANGELOG
1818
* Add `framework.http_cache.skip_response_headers` option
1919
* Display warmers duration on debug verbosity for `cache:clear` command
2020
* Add `AbstractController::sendEarlyHints()` to send HTTP Early Hints
21+
* Add services `httplug.http_client` and `Http\Client\HttpAsyncClient` for `Symfony\Component\HttpClient\HttplugClient` and alias all configured `scoped_clients` by interface `Http\Client\HttpAsyncClient`
22+
* Deprecate the `Http\Client\HttpClient` service, use `Psr\Http\Client\ClientInterface` instead
2123

2224
6.2
2325
---

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,7 +2356,8 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder
23562356
}
23572357

23582358
if (!$hasHttplug = ContainerBuilder::willBeAvailable('php-http/httplug', HttpAsyncClient::class, ['symfony/framework-bundle', 'symfony/http-client'])) {
2359-
$container->removeDefinition(HttpAsyncClient::class);
2359+
$container->removeDefinition('httplug.http_client');
2360+
$container->removeAlias(HttpAsyncClient::class);
23602361
$container->removeAlias(HttpClient::class);
23612362
}
23622363

@@ -2429,7 +2430,7 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder
24292430
}
24302431

24312432
if ($hasHttplug) {
2432-
$container->setDefinition('httplug.'.$name, new ChildDefinition(HttpAsyncClient::class))
2433+
$container->setDefinition('httplug.'.$name, new ChildDefinition('httplug.http_client'))
24332434
->replaceArgument(0, new Reference($name));
24342435

24352436
$container->registerAliasForArgument('httplug.'.$name, HttpAsyncClient::class, $name);

src/Symfony/Bundle/FrameworkBundle/Resources/config/http_client.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,16 @@
5050

5151
->alias(ClientInterface::class, 'psr18.http_client')
5252

53-
->set(HttpAsyncClient::class, HttplugClient::class)
53+
->set('httplug.http_client', HttplugClient::class)
5454
->args([
5555
service('http_client'),
5656
service(ResponseFactoryInterface::class)->ignoreOnInvalid(),
5757
service(StreamFactoryInterface::class)->ignoreOnInvalid(),
5858
])
5959

60-
->alias(\Http\Client\HttpClient::class, HttpAsyncClient::class)
61-
->deprecate(
62-
'symfony/http-client',
63-
'6.3',
64-
'The "%alias_id%" service is deprecated, use the "'.HttpAsyncClient::class.'" service for method "::sendAsyncRequest" and "'.ClientInterface::class.'" for "::sendRequest" instead',
65-
)
60+
->alias(HttpAsyncClient::class, 'httplug.http_client')
61+
->alias(\Http\Client\HttpClient::class, 'httplug.http_client')
62+
->deprecate('symfony/framework-bundle', '6.3', 'The "%alias_id%" service is deprecated, use the "'.ClientInterface::class.'" instead.',)
6663

6764
->set('http_client.abstract_retry_strategy', GenericRetryStrategy::class)
6865
->abstract()

0 commit comments

Comments
 (0)