API / Minn\Rest / RouteMatch

RouteMatch final class

Minn\Rest\RouteMatch · public/minn/src/Minn/Rest/RouteMatch.php · 68 lines

Finds the registered handler for a method and path among the runtime's route table.

Public

staticfind(array $namespaces, callable $routesFor, string $method, string $path): Minn\Runtime\Refusal|array#

The handler for a method and path across the registered namespaces, or the refusal.

$namespaceslist<string>the registered namespaces
$routesForcallable(string): array<string, list<array<string, mixed>>>the (filtered) routes of one namespace, or all when given ''
@return array{route: string, handler: array<string, mixed>, params: array<string, string>, defaults: array<string, mixed>}|Refusal
staticroute(array $namespaces, callable $routesFor, string $path): ?array#

The first registered route whose pattern matches a path, whatever the method, with its handlers; null when none does. An OPTIONS request is answered from this.

$namespaceslist<string>
$routesForcallable(string): array<string, list<array<string, mixed>>>
@return array{route: string, handlers: list<array<string, mixed>>}|null