Checks if a provider is properly configured.
Parameters
$idOrClassNamestring|<span class="WordPressAiClientProvidersclass-string”>WordPressAiClientProvidersclass-stringrequired- The provider ID or class name.
Source
public function isProviderConfigured(string $idOrClassName): bool
{
try {
$className = $this->resolveProviderClassName($idOrClassName);
// Use static method from ProviderInterface
/** @var class-string<ProviderInterface> $className */
$availability = $className::availability();
return $availability->isConfigured();
} catch (InvalidArgumentException $e) {
return \false;
}
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.