<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use App\Administration\Domain\Model\User\Email;
use App\Administration\Domain\Model\User\UserId;
use DomainException;

use function sprintf;

final class UserNotFoundException extends DomainException
{
    public static function withId(UserId $userId): self
    {
        return new self(sprintf(
            'User with ID "%s" not found.',
            $userId,
        ));
    }

    public static function withEmail(Email $email): self
    {
        return new self(sprintf(
            'User with email "%s" not found.',
            $email,
        ));
    }
}
