<?php

declare(strict_types=1);

namespace App\Scolarite\Domain\Exception;

use App\Administration\Domain\Model\User\UserId;
use App\Scolarite\Domain\Model\Homework\HomeworkId;
use DomainException;

use function sprintf;

final class EleveNonAffecteAuDevoirException extends DomainException
{
    public static function pourEleve(UserId $studentId, HomeworkId $homeworkId): self
    {
        return new self(sprintf(
            'L\'élève "%s" n\'appartient pas à la classe du devoir "%s".',
            $studentId,
            $homeworkId,
        ));
    }
}
