<?php

declare(strict_types=1);

namespace App\Administration\Domain\Exception;

use DomainException;

use function sprintf;

final class PeriodsOverlapException extends DomainException
{
    public static function between(string $periodA, string $periodB): self
    {
        return new self(sprintf(
            'Les périodes "%s" et "%s" se chevauchent.',
            $periodA,
            $periodB,
        ));
    }
}
