Repository navigation
Releases: SoloPHP/Contracts
Releases · SoloPHP/Contracts
Release list
v1.5.0
Added
Router\AllowedMethodsInterface— optional router capability:getAllowedMethods(string $uri): list<string>, the methods a path is routed for. Lets callers answer405 Method Not Allowedwith anAllowheader instead of404 Not Found. Implemented bysolophp/router3.5.
Changed
RouterInterface::match()documents the result routers actually return:middlewaresmay hold strings (ids the caller resolves, e.g. class names) as well as callables, andnameandattributesare optional keys. Code typed against the interface no longer needs a@varannotation to read them.RouterInterface::match()documents that method names are case-sensitive (RFC 9110) and that parameters are returned as they appear in the URI path, undecoded.RouterInterface: the array form of a handler is documented asarray{class-string, string}, and theaddRoute()options asgroup,middlewares,nameandattributes.WritableContainerInterfacedocuments that services are shared — the factory runs on the firstget()and later calls return the same instance — and that factories receive the container.
PHPDoc only: no signatures changed, existing implementations keep working.
v1.4.0
Added
JobQueueListener— observability hooks:onClaimed/onCompleted/onFailed/onReclaimedJobQueueInterface:pushMany,getStats,reclaimStuck,getFailedJobs,retry
Changed (breaking)
JobQueueInterface::processJobs()now returnsint— number of jobs executed (wasvoid)JobQueueInterface::markFailed()acceptsThrowable|string(wasstring)
v1.3.0
ValidatorInterface
- Removed
$messagesparameter fromvalidate()method. validate()now returns a structured errors array instead of string messages:
/** @return array<string, list<array{rule: string, params?: string[]}>> */This separates validation logic from message formatting — the validator returns only the rule name and parameters, leaving error message rendering to the caller.
v1.2.0
Breaking Changes
RouterInterface::addRoute()— return type changed fromvoidtoobject- Implementations must now return an object (typically
$thisfor fluent interface) - Enables method chaining when adding routes:
$router->addRoute(...)->addRoute(...)
- Implementations must now return an object (typically
v1.1.0
v1.0.0
v1.0.0 - Initial Release
First stable release of SoloPHP Contracts.
Added:
- RouterInterface - HTTP routing contract
- ValidatorInterface - Data validation contract
- JobInterface - Executable job contract
- JobQueueInterface - Job queue management contract with scheduling and retry support