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,48 @@
<?php
declare(strict_types=1);
namespace Kreait\Firebase\Auth;
use DateTimeImmutable;
use Kreait\Firebase\Util\DT;
use function array_key_exists;
/**
* @phpstan-type MfaInfoResponseShape array{
* mfaEnrollmentId: non-empty-string,
* displayName?: non-empty-string,
* phoneInfo?: non-empty-string,
* enrolledAt?: non-empty-string
* }
*/
final class MfaInfo
{
private function __construct(
public readonly string $mfaEnrollmentId,
public readonly ?string $displayName,
public readonly ?string $phoneInfo,
public readonly ?DateTimeImmutable $enrolledAt,
) {
}
/**
* @internal
*
* @param MfaInfoResponseShape $data
*/
public static function fromResponseData(array $data): self
{
$enrolledAt = array_key_exists('enrolledAt', $data)
? DT::toUTCDateTimeImmutable($data['enrolledAt'])
: null;
return new self(
$data['mfaEnrollmentId'],
$data['displayName'] ?? null,
$data['phoneInfo'] ?? null,
$enrolledAt,
);
}
}