-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip auto-installing when the root package's extra.discovery is enough (
#239)
- Loading branch information
1 parent
1c44ede
commit 29ae6fa
Showing
6 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
<?php | ||
|
||
use Http\Discovery\Psr17FactoryDiscovery; | ||
use Http\Discovery\Psr18ClientDiscovery; | ||
use Psr\Http\Client\ClientInterface; | ||
use Psr\Http\Message\RequestInterface; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
require __DIR__.'/vendor/autoload.php'; | ||
|
||
echo get_class(Psr17FactoryDiscovery::findRequestFactory())."\n"; | ||
class MyClient implements ClientInterface | ||
{ | ||
public function sendRequest(RequestInterface $request): ResponseInterface | ||
{ | ||
return Psr17FactoryDiscovery::findResponseFactory()->createResponse(); | ||
} | ||
} | ||
|
||
echo get_class(Psr17FactoryDiscovery::findRequestFactory()); | ||
echo '-', get_class(Psr18ClientDiscovery::find()); | ||
echo "\n"; |