Skip to content

Commit be67877

Browse files
authored
chore(http-client): update PSR discovery package to psr-discovery/http-client-implementations and psr-discovery/http-factory-implementations
1 parent f3dd1f3 commit be67877

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"nikic/php-parser": "^5.3",
2323
"nunomaduro/collision": "^8.4",
2424
"php": "^8.3",
25-
"php-http/discovery": "^1.19.2",
25+
"psr-discovery/http-client-implementations": "1.x-dev",
26+
"psr-discovery/http-factory-implementations": "1.x-dev",
2627
"psr/cache": "^3.0",
2728
"psr/clock": "^1.0.0",
2829
"psr/http-client": "^1.0.0",
@@ -43,7 +44,6 @@
4344
"illuminate/view": "~11.7.0",
4445
"jenssegers/blade": "^2.0",
4546
"nyholm/psr7": "^1.8",
46-
"php-http/mock-client": "^1.6",
4747
"phpat/phpat": "^0.10.14",
4848
"phpstan/phpstan": "^1.10.0",
4949
"phpunit/phpunit": "^11.3.5",
@@ -134,11 +134,6 @@
134134
"bin": [
135135
"src/Tempest/Console/bin/tempest"
136136
],
137-
"config": {
138-
"allow-plugins": {
139-
"php-http/discovery": true
140-
}
141-
},
142137
"scripts": {
143138
"phpunit": "vendor/bin/phpunit --display-warnings --display-skipped --display-deprecations --display-errors --display-notices",
144139
"coverage": "vendor/bin/phpunit --coverage-html build/reports/html --coverage-clover build/reports/clover.xml",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":[],"times":{"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_send_request_proxies_to_http_client":0.003,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_get_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_get_with_headers_proxies_to_http_client_with_headers":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_head_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_post_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_trace_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_put_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_patch_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_delete_proxies_to_http_client":0,"Tempest\\HttpClient\\Tests\\GenericHttpClientTest::test_options_proxies_to_http_client":0}}

src/Tempest/HttpClient/composer.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"minimum-stability": "dev",
66
"require": {
77
"php": "^8.3",
8-
"php-http/discovery": "^1.19.2",
98
"psr/http-client": "^1.0.0",
109
"psr/http-message": "^1.0|^2.0",
1110
"tempest/container": "dev-main",
12-
"tempest/http": "dev-main"
11+
"tempest/http": "dev-main",
12+
"psr-discovery/http-factory-implementations": "1.x-dev",
13+
"psr-discovery/http-client-implementations": "1.x-dev"
1314
},
1415
"require-dev": {
1516
"aidan-casey/mock-client": "dev-master",
@@ -24,10 +25,5 @@
2425
"psr-4": {
2526
"Tempest\\HttpClient\\Tests\\": "tests"
2627
}
27-
},
28-
"config": {
29-
"allow-plugins": {
30-
"php-http/discovery": true
31-
}
3228
}
3329
}

src/Tempest/HttpClient/src/HttpClientDriverInitializer.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44

55
namespace Tempest\HttpClient;
66

7-
use Http\Discovery\Psr17FactoryDiscovery;
8-
use Http\Discovery\Psr18ClientDiscovery;
97
use Psr\Http\Client\ClientInterface;
8+
use PsrDiscovery\Discover;
109
use Tempest\Container\Container;
1110
use Tempest\Container\Initializer;
1211
use Tempest\Container\Singleton;
@@ -18,10 +17,10 @@ final class HttpClientDriverInitializer implements Initializer
1817
public function initialize(Container $container): HttpClientDriver|ClientInterface
1918
{
2019
return new Psr18Driver(
21-
client: Psr18ClientDiscovery::find(),
22-
uriFactory: Psr17FactoryDiscovery::findUriFactory(),
23-
requestFactory: Psr17FactoryDiscovery::findRequestFactory(),
24-
streamFactory: Psr17FactoryDiscovery::findStreamFactory()
20+
client: Discover::httpClient(),
21+
uriFactory: Discover::httpUriFactory(),
22+
requestFactory: Discover::httpRequestFactory(),
23+
streamFactory: Discover::httpStreamFactory(),
2524
);
2625
}
2726
}

0 commit comments

Comments
 (0)