vendor/auth0/auth0-php/src/Exception/ConfigurationException.php line 51

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Auth0\SDK\Exception;
  4. /**
  5.  * @codeCoverageIgnore
  6.  */
  7. final class ConfigurationException extends \Exception implements Auth0Exception
  8. {
  9.     public const MSG_CONFIGURATION_REQUIRED 'The Auth0 SDK requires an SdkConfiguration be provided at initialization';
  10.     public const MSG_STRATEGY_REQUIRED 'The Auth0 SDK requires a `strategy` to be configured';
  11.     public const MSG_VALUE_REQUIRED '`%s` is not configured';
  12.     public const MSG_SET_IMMUTABLE 'Changes cannot be applied to a locked configuration';
  13.     public const MSG_SET_MISSING 'Attempted to assign a value to undefined property "%s"';
  14.     public const MSG_SET_INCOMPATIBLE 'Parameter "%s" must be of type %s, %s used';
  15.     public const MSG_SET_INCOMPATIBLE_NULLABLE 'Parameter "%s" must be of type %s or null, %s used';
  16.     public const MSG_GET_MISSING 'Attempted to retrieve the value of an undefined property "%s"';
  17.     public const MSG_VALIDATION_FAILED 'Validation of "%s" was unsuccessful';
  18.     public const MSG_REQUIRES_AUDIENCE '`audience` must be configured';
  19.     public const MSG_REQUIRES_COOKIE_SECRET '`cookieSecret` must be configured';
  20.     public const MSG_REQUIRES_CLIENT_ID '`clientId` must be configured';
  21.     public const MSG_REQUIRES_CLIENT_SECRET '`clientSecret` must be configured';
  22.     public const MSG_REQUIRES_DOMAIN '`domain` must be configured';
  23.     public const MSG_REQUIRES_MANAGEMENT_KEY '`managementToken` must be configured';
  24.     public const MSG_REQUIRES_REDIRECT_URI '`redirectUri` must be configured';
  25.     public const MSG_REQUIRES_RETURN_URI '`returnUri` must be configured';
  26.     public const MSG_INVALID_TOKEN_ALGORITHM 'Invalid token algorithm; must be "HS256" or "RS256"';
  27.     public const MSG_NO_PSR18_LIBRARY 'No compatible PSR-18 library was configured, and one could not be auto-discovered.';
  28.     public const MSG_NO_PSR17_LIBRARY 'No compatible PSR-17 library was configured, and one could not be auto-discovered.';
  29.     public static function requiresConfiguration(
  30.         ?\Throwable $previous null
  31.     ): self {
  32.         return new self(self::MSG_CONFIGURATION_REQUIRED0$previous);
  33.     }
  34.     public static function requiresStrategy(
  35.         ?\Throwable $previous null
  36.     ): self {
  37.         return new self(self::MSG_STRATEGY_REQUIRED0$previous);
  38.     }
  39.     public static function requiresDomain(
  40.         ?\Throwable $previous null
  41.     ): self {
  42.         return new self(self::MSG_REQUIRES_DOMAIN0$previous);
  43.     }
  44.     public static function requiresAudience(
  45.         ?\Throwable $previous null
  46.     ): self {
  47.         return new self(self::MSG_REQUIRES_AUDIENCE0$previous);
  48.     }
  49.     public static function requiresCookieSecret(
  50.         ?\Throwable $previous null
  51.     ): self {
  52.         return new self(self::MSG_REQUIRES_COOKIE_SECRET0$previous);
  53.     }
  54.     public static function requiresClientId(
  55.         ?\Throwable $previous null
  56.     ): self {
  57.         return new self(self::MSG_REQUIRES_CLIENT_ID0$previous);
  58.     }
  59.     public static function requiresClientSecret(
  60.         ?\Throwable $previous null
  61.     ): self {
  62.         return new self(self::MSG_REQUIRES_CLIENT_SECRET0$previous);
  63.     }
  64.     public static function requiresManagementToken(
  65.         ?\Throwable $previous null
  66.     ): self {
  67.         return new self(self::MSG_REQUIRES_MANAGEMENT_KEY0$previous);
  68.     }
  69.     public static function requiresRedirectUri(
  70.         ?\Throwable $previous null
  71.     ): self {
  72.         return new self(self::MSG_REQUIRES_REDIRECT_URI0$previous);
  73.     }
  74.     public static function requiresReturnUri(
  75.         ?\Throwable $previous null
  76.     ): self {
  77.         return new self(self::MSG_REQUIRES_RETURN_URI0$previous);
  78.     }
  79.     public static function required(
  80.         string $propertyName,
  81.         ?\Throwable $previous null
  82.     ): self {
  83.         return new self(sprintf(self::MSG_VALUE_REQUIRED$propertyName), 0$previous);
  84.     }
  85.     public static function setImmutable(
  86.         ?\Throwable $previous null
  87.     ): self {
  88.         return new self(self::MSG_SET_IMMUTABLE0$previous);
  89.     }
  90.     public static function setMissing(
  91.         string $propertyName,
  92.         ?\Throwable $previous null
  93.     ): self {
  94.         return new self(sprintf(self::MSG_SET_MISSING$propertyName), 0$previous);
  95.     }
  96.     public static function setIncompatible(
  97.         string $propertyName,
  98.         string $expectedType,
  99.         string $usedType,
  100.         ?\Throwable $previous null
  101.     ): self {
  102.         return new self(sprintf(self::MSG_SET_INCOMPATIBLE$propertyName$expectedType$usedType), 0$previous);
  103.     }
  104.     public static function setIncompatibleNullable(
  105.         string $propertyName,
  106.         string $expectedType,
  107.         string $usedType,
  108.         ?\Throwable $previous null
  109.     ): self {
  110.         return new self(sprintf(self::MSG_SET_INCOMPATIBLE_NULLABLE$propertyName$expectedType$usedType), 0$previous);
  111.     }
  112.     public static function getMissing(
  113.         string $propertyName,
  114.         ?\Throwable $previous null
  115.     ): self {
  116.         return new self(sprintf(self::MSG_GET_MISSING$propertyName), 0$previous);
  117.     }
  118.     public static function validationFailed(
  119.         string $propertyName,
  120.         ?\Throwable $previous null
  121.     ): self {
  122.         return new self(sprintf(self::MSG_VALIDATION_FAILED$propertyName), 0$previous);
  123.     }
  124.     public static function invalidAlgorithm(
  125.         ?\Throwable $previous null
  126.     ): self {
  127.         return new self(self::MSG_INVALID_TOKEN_ALGORITHM0$previous);
  128.     }
  129.     public static function missingPsr18Library(
  130.         ?\Throwable $previous null
  131.     ): self {
  132.         return new self(self::MSG_NO_PSR18_LIBRARY0$previous);
  133.     }
  134.     public static function missingPsr17Library(
  135.         ?\Throwable $previous null
  136.     ): self {
  137.         return new self(self::MSG_NO_PSR17_LIBRARY0$previous);
  138.     }
  139. }