{@inheritDoc}
Parameters
$typestringrequired- The type of discovery.
Source
public static function getCandidates($type)
{
if (ClientInterface::class === $type) {
return [['class' => static function () {
$psr17Factory = new Psr17Factory();
return static::createClient($psr17Factory);
}]];
}
$psr17Factories = ['WordPress\AiClientDependencies\Psr\Http\Message\RequestFactoryInterface', 'WordPress\AiClientDependencies\Psr\Http\Message\ResponseFactoryInterface', 'WordPress\AiClientDependencies\Psr\Http\Message\ServerRequestFactoryInterface', 'WordPress\AiClientDependencies\Psr\Http\Message\StreamFactoryInterface', 'WordPress\AiClientDependencies\Psr\Http\Message\UploadedFileFactoryInterface', 'WordPress\AiClientDependencies\Psr\Http\Message\UriFactoryInterface'];
if (in_array($type, $psr17Factories, \true)) {
return [['class' => Psr17Factory::class]];
}
return [];
}
Changelog
| Version | Description |
|---|---|
| 1.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.