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:
53
vendor/kreait/firebase-php/src/Firebase/Auth/UserMetaData.php
vendored
Normal file
53
vendor/kreait/firebase-php/src/Firebase/Auth/UserMetaData.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Kreait\Firebase\Auth;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use Kreait\Firebase\Util\DT;
|
||||
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* @phpstan-type UserMetadataResponseShape array{
|
||||
* createdAt: non-empty-string,
|
||||
* lastLoginAt?: non-empty-string,
|
||||
* passwordUpdatedAt?: non-empty-string,
|
||||
* lastRefreshAt?: non-empty-string
|
||||
* }
|
||||
*/
|
||||
final class UserMetaData
|
||||
{
|
||||
public function __construct(
|
||||
public readonly DateTimeImmutable $createdAt,
|
||||
public readonly ?DateTimeImmutable $lastLoginAt,
|
||||
public readonly ?DateTimeImmutable $passwordUpdatedAt,
|
||||
public readonly ?DateTimeImmutable $lastRefreshAt,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @param UserMetadataResponseShape $data
|
||||
*/
|
||||
public static function fromResponseData(array $data): self
|
||||
{
|
||||
$createdAt = DT::toUTCDateTimeImmutable($data['createdAt']);
|
||||
|
||||
$lastLoginAt = array_key_exists('lastLoginAt', $data)
|
||||
? DT::toUTCDateTimeImmutable($data['lastLoginAt'])
|
||||
: null;
|
||||
|
||||
$passwordUpdatedAt = array_key_exists('passwordUpdatedAt', $data)
|
||||
? DT::toUTCDateTimeImmutable($data['passwordUpdatedAt'])
|
||||
: null;
|
||||
|
||||
$lastRefreshAt = array_key_exists('lastRefreshAt', $data)
|
||||
? DT::toUTCDateTimeImmutable($data['lastRefreshAt'])
|
||||
: null;
|
||||
|
||||
return new self($createdAt, $lastLoginAt, $passwordUpdatedAt, $lastRefreshAt);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user