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
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:
48
vendor/kreait/firebase-php/src/Firebase/Auth/MfaInfo.php
vendored
Normal file
48
vendor/kreait/firebase-php/src/Firebase/Auth/MfaInfo.php
vendored
Normal 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user