<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use App\Administration\Domain\Model\ActivationToken\ActivationTokenId;
use DomainException;

use function sprintf;

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