Expirable.php 363 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<?php

declare(strict_types=1);

namespace Kreait\Firebase\JWT\Contract;

use DateTimeImmutable;
use DateTimeInterface;

interface Expirable
{
    /**
     * @return self
     */
    public function withExpirationTime(DateTimeImmutable $time);

    public function isExpiredAt(DateTimeInterface $now): bool;

    public function expiresAt(): DateTimeImmutable;
}