Files
kulakpos_web/vendor/kreait/firebase-php/src/Firebase/Auth/MfaInfo.php
triagungbiantoro 417b7b7453
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m27s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 31s
Build, Push and Deploy / deploy-production (push) Has been skipped
harga pada beranda terhubung ke manage plans di dashboard admin
2026-04-25 21:57:25 +07:00

49 lines
1.1 KiB
PHP
Executable File

<?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,
);
}
}