[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Providers/Http/Enums/ -> RequestAuthenticationMethod.php (source)

   1  <?php
   2  
   3  declare (strict_types=1);
   4  namespace WordPress\AiClient\Providers\Http\Enums;
   5  
   6  use WordPress\AiClient\Common\AbstractEnum;
   7  use WordPress\AiClient\Common\Contracts\WithArrayTransformationInterface;
   8  use WordPress\AiClient\Providers\Http\Contracts\RequestAuthenticationInterface;
   9  use WordPress\AiClient\Providers\Http\DTO\ApiKeyRequestAuthentication;
  10  /**
  11   * Enum for request authentication methods.
  12   *
  13   * @since 0.4.0
  14   *
  15   * @method static self apiKey() Creates an instance for API_KEY method.
  16   * @method bool isApiKey() Checks if the method is API_KEY.
  17   */
  18  class RequestAuthenticationMethod extends AbstractEnum
  19  {
  20      /**
  21       * API key authentication.
  22       */
  23      public const API_KEY = 'api_key';
  24      /**
  25       * Gets the implementation class for the authentication method.
  26       *
  27       * @since 0.4.0
  28       *
  29       * @return class-string<RequestAuthenticationInterface&WithArrayTransformationInterface> The implementation class.
  30       *
  31       * @phpstan-ignore missingType.generics
  32       */
  33      public function getImplementationClass(): string
  34      {
  35          // At the moment, this is the only supported method.
  36          // Once more methods are available, add conditionals here for each method.
  37          return ApiKeyRequestAuthentication::class;
  38      }
  39  }


Generated : Fri Jul 24 08:20:19 2026 Cross-referenced by PHPXref