WordPress\AiClient\Providers

ProviderRegistry::getProviderRequestAuthenticationpublicWP 0.1.0

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

Method of the class: ProviderRegistry{}

No Hooks.

Returns

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

Usage

$ProviderRegistry = new ProviderRegistry();
$ProviderRegistry->getProviderRequestAuthentication( $idOrClassName ): ?RequestAuthenticationInterface;
$idOrClassName(string|class-string) (required)
The provider ID or class name.

Changelog

Since 0.1.0 Introduced.

ProviderRegistry::getProviderRequestAuthentication() code WP 7.0

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