private function timeElementsAreValid($hours, $minutes, $seconds): bool
    {
        $exception = new \InvalidArgumentException(
            \sprintf('Invalid time "%02d:%02d:%02d".', $hours, $minutes, $seconds)
        );

        if ((int)\sprintf('%d%02d%02d', $hours, $minutes, $seconds) > 240000) {
            throw $exception;
        }
        if ($hours < 0 || $minutes < 0 || $seconds < 0) {
            throw $exception;
        }
        if ($hours <= 24 && $minutes <= 59 && $seconds <= 59) {
            return true;
        }

        throw $exception;
    }