X

Create New Item

File Folder

X

Search Results

File "IdTokenVerificationFailed.php"

Full path: /home/orbitecv/orbite-school.orbit.et/vendor/kreait/firebase-tokens/src/JWT/Error/IdTokenVerificationFailed.php
File size: 634 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?php

declare(strict_types=1);

namespace Kreait\Firebase\JWT\Error;

use RuntimeException;

use const PHP_EOL;

final class IdTokenVerificationFailed extends RuntimeException
{
    /**
     * @param array<int|string, 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);
    }
}