ProviderRegistry::getProviderRequestAuthentication( string|WordPressAiClientProvidersclass-string $idOrClassName ): WordPressAiClientProviders?RequestAuthenticationInterface

In this article

Gets the request authentication instance for the given provider, if set.

Parameters

$idOrClassNamestring|<span class="WordPressAiClientProvidersclass-string”>WordPressAiClientProvidersclass-stringrequired
The provider ID or class name.

Return

WordPressAiClientProviders?RequestAuthenticationInterface The request authentication instance, or null if not set.

Source

public function getProviderRequestAuthentication(string $idOrClassName): ?RequestAuthenticationInterface
{
    $className = $this->resolveProviderClassName($idOrClassName);
    if (!isset($this->providerAuthenticationInstances[$className])) {
        return null;
    }
    return $this->providerAuthenticationInstances[$className];
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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