<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use DomainException;

use function sprintf;

final class InvalidPeriodCountException extends DomainException
{
    public static function forType(string $type, int $expected, int $actual): self
    {
        return new self(sprintf(
            'Le mode "%s" attend %d période(s), mais %d fournie(s).',
            $type,
            $expected,
            $actual,
        ));
    }
}
