<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use App\Administration\Domain\Model\PasswordResetToken\PasswordResetTokenId;
use DomainException;

use function sprintf;

final class PasswordResetTokenAlreadyUsedException extends DomainException
{
    public static function forToken(PasswordResetTokenId $tokenId): self
    {
        return new self(sprintf(
            'Password reset token "%s" has already been used.',
            $tokenId,
        ));
    }
}
