WordPress\AiClientDependencies\Http\Discovery
Psr18ClientDiscovery::find
Finds a PSR-18 HTTP Client.
Method of the class: Psr18ClientDiscovery{}
No Hooks.
Returns
ClientInterface.
Usage
$result = Psr18ClientDiscovery::find();
Psr18ClientDiscovery::find() Psr18ClientDiscovery::find code WP 7.0
public static function find()
{
try {
$client = static::findOneByType(ClientInterface::class);
} catch (DiscoveryFailedException $e) {
throw new RealNotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e);
}
return static::instantiateClass($client);
}