Context
LightningConfig accepts values without validation. A misconfiguration (e.g. min > max sendable range, empty/invalid callback URL) surfaces late as confusing runtime behavior rather than a clear config-time error.
src/Config/LightningConfig.php — fluent setters; setSendableRange(int $min, int $max), setCallbackUrl(string), setDomain(string).
src/Shared/Value/SendableRange.php — withMinMax(int $min, int $max) does no ordering check.
Goal
Fail fast with clear messages on invalid configuration.
Scope / Tasks
Implementation notes
- Prefer runtime validation with clear messages over silent coercion.
- Match existing exception style (
RuntimeException with an interpolated, specific message), consistent with LightningConfig::addBackendsFile() and BackendType::fromString().
- Don't over-validate: only guard values that cause real downstream breakage.
Acceptance criteria
References
Context
LightningConfigaccepts values without validation. A misconfiguration (e.g.min > maxsendable range, empty/invalid callback URL) surfaces late as confusing runtime behavior rather than a clear config-time error.src/Config/LightningConfig.php— fluent setters;setSendableRange(int $min, int $max),setCallbackUrl(string),setDomain(string).src/Shared/Value/SendableRange.php—withMinMax(int $min, int $max)does no ordering check.Goal
Fail fast with clear messages on invalid configuration.
Scope / Tasks
min >= 1,max >= min(LUD-06:minSendablecannot be less than 1 or greater thanmaxSendable). Throw a clear exception otherwise — decide whether the guard lives inSendableRange::withMinMax()(preferred, single source of truth) or the setter.callbackUrlis a non-empty, parseable URL (or documented base).setDomain()'s scheme-stripping behavior; reject clearly empty/invalid domains.Implementation notes
RuntimeExceptionwith an interpolated, specific message), consistent withLightningConfig::addBackendsFile()andBackendType::fromString().Acceptance criteria
min > max,min < 1, empty/invalid callback URL each throw a specific, actionable exception.composer test-allgreen.References