Skip to content

Releases: SoloPHP/Contracts

v1.5.0

Choose a tag to compare

@SoloPHP SoloPHP released this 16 Oct 20:19

Added

  • Router\AllowedMethodsInterface — optional router capability: getAllowedMethods(string $uri): list<string>, the methods a path is routed for. Lets callers answer 405 Method Not Allowed with an Allow header instead of 404 Not Found. Implemented by solophp/router 3.5.

Changed

  • RouterInterface::match() documents the result routers actually return: middlewares may hold strings (ids the caller resolves, e.g. class names) as well as callables, and name and attributes are optional keys. Code typed against the interface no longer needs a @var annotation 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 as array{class-string, string}, and the addRoute() options as group, middlewares, name and attributes.
  • WritableContainerInterface documents that services are shared — the factory runs on the first get() 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

Choose a tag to compare

@SoloPHP SoloPHP released this 19 May 17:31

Added

  • JobQueueListener — observability hooks: onClaimed / onCompleted / onFailed / onReclaimed
  • JobQueueInterface: pushMany, getStats, reclaimStuck, getFailedJobs, retry

Changed (breaking)

  • JobQueueInterface::processJobs() now returns int — number of jobs executed (was void)
  • JobQueueInterface::markFailed() accepts Throwable|string (was string)

v1.3.0

Choose a tag to compare

@SoloPHP SoloPHP released this 17 Feb 13:08

ValidatorInterface

  • Removed $messages parameter from validate() 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

Choose a tag to compare

@SoloPHP SoloPHP released this 06 Dec 09:54

Breaking Changes

  • RouterInterface::addRoute() — return type changed from void to object
    • Implementations must now return an object (typically $this for fluent interface)
    • Enables method chaining when adding routes: $router->addRoute(...)->addRoute(...)

v1.1.0

Choose a tag to compare

@SoloPHP SoloPHP released this 04 Dec 20:41

Added

  • WritableContainerInterface — PSR-11 extension with set() method for service registration
  • EmitterInterface — HTTP response emitter for PSR-7 responses

v1.0.0

Choose a tag to compare

@SoloPHP SoloPHP released this 13 Oct 08:49

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