Skip to content

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.