ResolvedRouteInfo
in package
Represents a resolved route.
Table of Contents
Methods
- __construct() : mixed
- dispatch() : mixed
- Dispatches this route.
- getSupportedMethods() : array<string|int, string>
- Gets the list of supported HTTP request methods for this route.
- hasHandler() : bool
- Whether this route has a handler.
- hasOtherMethods() : bool
- Whether this route supports other HTTP request methods.
- runMiddleware() : mixed
- Run middleware handlers.
Methods
__construct()
public
__construct(array<string|int, array{: callable, : array}> $middlewares, array<string|int, string> $supportedMethods, callable(): mixed|null $handler, array<string|int, mixed> $args) : mixed
Parameters
- $middlewares : array<string|int, array{: callable, : array}>
-
Middlewares that should be run prior to the route handler.
- $supportedMethods : array<string|int, string>
-
HTTP methods that this route accepts.
- $handler : callable(): mixed|null
-
Route handler.
- $args : array<string|int, mixed>
-
Argument list to pass to the middleware and route handlers.
dispatch()
Dispatches this route.
public
dispatch(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
Additional arguments to pass to the route handler.
Return values
mixed —Return value of the route handler.
getSupportedMethods()
Gets the list of supported HTTP request methods for this route.
public
getSupportedMethods() : array<string|int, string>
Return values
array<string|int, string> —Supported HTTP request methods.
hasHandler()
Whether this route has a handler.
public
hasHandler() : bool
Return values
bool —true if it does.
hasOtherMethods()
Whether this route supports other HTTP request methods.
public
hasOtherMethods() : bool
Return values
bool —true if it does.
runMiddleware()
Run middleware handlers.
public
runMiddleware(array<string|int, mixed> $args) : mixed
Parameters
- $args : array<string|int, mixed>
-
Additional arguments to pass to the middleware handlers.
Return values
mixed —Return value from the first middleware to return anything non-null, otherwise null.