<?php

declare(strict_types=1);

namespace App\Domain\Reader\Domain\Exception;

use App\Domain\Reader\Domain\ValueObject\ChapterId;
use App\Domain\Reader\Domain\ValueObject\PageNumber;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

final class PageNotFoundException extends NotFoundHttpException
{
    public static function forPage(ChapterId $chapterId, PageNumber $pageNumber): self
    {
        return new self(sprintf('La page %d du chapitre %s n\'existe pas', $pageNumber->getValue(), $chapterId->getValue()));
    }
}
