allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s

This commit is contained in:
2026-03-30 14:54:57 +07:00
parent 66aed7c4e8
commit b5e3a778ce
21316 changed files with 2777892 additions and 13 deletions

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Kreait\Firebase\JWT\Error;
use RuntimeException;
use Throwable;
final class CustomTokenCreationFailed extends RuntimeException
{
public static function because(string $reason, ?int $code = null, ?Throwable $previous = null): self
{
$code = $code ?: 0;
return new self($reason, $code, $previous);
}
}

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Kreait\Firebase\JWT\Error;
use RuntimeException;
use Throwable;
final class FetchingGooglePublicKeysFailed extends RuntimeException
{
public static function because(string $reason, ?int $code = null, ?Throwable $previous = null): self
{
$code = $code ?: 0;
return new self($reason, $code, $previous);
}
}

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Kreait\Firebase\JWT\Error;
use RuntimeException;
use const PHP_EOL;
final class IdTokenVerificationFailed extends RuntimeException
{
/**
* @param array<non-empty-string> $reasons
*/
public static function withTokenAndReasons(string $token, array $reasons): self
{
if (mb_strlen($token) > 18) {
$token = mb_substr($token, 0, 15).'...';
}
$summary = implode(PHP_EOL.'- ', $reasons);
$message = "The value '{$token}' is not a verified ID token:".PHP_EOL.'- '.$summary.PHP_EOL;
return new self($message);
}
}

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Kreait\Firebase\JWT\Error;
use RuntimeException;
use const PHP_EOL;
final class SessionCookieVerificationFailed extends RuntimeException
{
/**
* @param array<int|string, string> $reasons
*/
public static function withSessionCookieAndReasons(string $token, array $reasons): self
{
if (mb_strlen($token) > 18) {
$token = mb_substr($token, 0, 15).'...';
}
$summary = implode(PHP_EOL.'- ', $reasons);
$message = "The value '{$token}' is not a verified session cookie:".PHP_EOL.'- '.$summary.PHP_EOL;
return new self($message);
}
}