Skip to content

Commit 9657377

Browse files
committed
Use php-http/discovery to automatically find a psr-compliant HTTP client
1 parent ec25af4 commit 9657377

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

bin/feedio

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ function main($argc, $argv)
2020
exit;
2121
}
2222

23-
$feedIo = new FeedIo;
23+
$client = \Http\Discovery\HttpClientDiscovery::find();
24+
$feedIo = new FeedIo($client);
2425
switch($argv[1]) {
2526
case 'discover':
2627
discover($feedIo, $argv[2]);

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"ext-libxml": "*",
2222
"psr/log": "~1.0|~2.0|~3.0",
2323
"php-http/httplug": "^2.3",
24-
"nyholm/psr7": "^1.5"
24+
"nyholm/psr7": "^1.5",
25+
"php-http/discovery": "^1.14"
2526
},
2627
"require-dev": {
2728
"phpunit/phpunit": "~9.3.0",

composer.lock

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)