AbstractClientDiscoveryStrategy::createClient( WordPressAiClientDependenciesNyholmPsr7FactoryPsr17Factory $psr17Factory ): WordPressAiClientDependenciesPsrHttpClientClientInterface

In this article

Creates an instance of the HTTP client.

Description

Subclasses must implement this method to return their specific PSR-18 HTTP client instance. The provided Psr17Factory implements all PSR-17 interfaces (RequestFactory, ResponseFactory, StreamFactory, etc.) and can be used to satisfy client constructor dependencies.

Parameters

$psr17FactoryWordPressAiClientDependenciesNyholmPsr7FactoryPsr17Factoryrequired
The PSR-17 factory for creating HTTP messages.

Return

WordPressAiClientDependenciesPsrHttpClientClientInterface The PSR-18 HTTP client.

Source

abstract protected static function createClient(Psr17Factory $psr17Factory): ClientInterface;

Changelog

VersionDescription
1.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.