Route final readonly class
Minn\Http\Route · public/minn/src/Minn/Http/Route.php · 75 lines
Declares a handler method as a route. The policy lives here, as metadata the router enforces before the handler runs, so the authorization surface of the engine is a grep away; a route with no policy is one the ratchet in the style suite counts down. The parameter sets it reads live here too, judged before the policy is (the reference refuses a bad argument before it refuses a caller), so the REST index can tell a client what a route takes as well as what it requires of them.
Patterns: "/wp/v2/posts/{id}" captures one segment, "{id:\d+}" constrains it, and "/{path*}" captures the rest of the path (slashes included).
Used by 53 (show)
Constants and properties
| prop | readonly Minn\Http\Method $method | Promoted from the constructor. |
| prop | readonly string $pattern | Promoted from the constructor. |
| prop | readonly ?Minn\Http\Policy $policy | Promoted from the constructor. |
| prop | readonly array $args | Promoted from the constructor. |
| prop | readonly bool $index | Promoted from the constructor. |
| prop | readonly array $body | Promoted from the constructor. |
| prop | readonly ?string $name | Promoted from the constructor. |
| prop | readonly ?string $params | Promoted from the constructor. |
| prop | readonly ?string $refuse | Promoted from the constructor. |
Public
| new | __construct(Minn\Http\Method $method, string $pattern, ?Minn\Http\Policy $policy = NULL, array $args = array ( ), bool $index = true, array $body = array ( ), ?string $name = NULL, ?string $params = NULL, ?string $refuse = NULL)# |
| ||||||||||||||||||
| method | arguments(array $captures = array ( )): array# | The parameters this route accepts, as the REST index publishes them: from its params source for these captures (a capture the pattern fixes, such as {base:posts}, counts when none is given), or its fixed sets.
@return array<string, array<string, mixed>> | ||||||||||||||||||
| method | bodyArguments(): array# | The parameters this route reads from the JSON body, validated before the caller is judged. @return array<string, array<string, mixed>> | ||||||||||||||||||
| method | regex(): string# | The pattern as a regular expression with named captures. |
Nothing matches.