ArgCheck final readonly class
Minn\Rest\ArgCheck · public/minn/src/Minn/Rest/ArgCheck.php · 142 lines
Judges a route's declared arguments against the request before the policy is judged, the way the reference does: a required parameter that did not arrive is rest_missing_callback_param; the shared collection parameters (context, page, per_page, search) are judged first and a refusal among them is answered alone; then every other invalid one is listed in rest_invalid_param, in the order the route declares them, with the schema's own refusal under details (none for an argument whose refusal is bare, Args::BARE_REFUSAL). An argument judged in the sanitize round (Args::SANITIZE_ROUND) is read only once all the others passed. The query is read against the route's args, the JSON body against its body set, and a JSON body that does not parse is refused on every route first. An argument its handler judges (Args::HANDLER_VALIDATES) is left to the handler.
Constants and properties
| private | readonly Minn\Rest\Schema $schema | Promoted from the constructor. |
Public
| new | __construct(Minn\Rest\Schema $schema)# | ||||
| method | closure(): Closure# | The check as the router takes it. | |||
| method | check(Minn\Http\Route $route, Minn\Http\Request $request, array $captures = array ( )): void# | Throws the refusal the declared arguments earn, or returns. @param array<string, string> $captures what the path named, for a route whose parameters depend on it
|
Internals 6
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | json(Minn\Http\Request $request): void# | A JSON body that does not parse is refused on every route, before its arguments are read; an empty one is not a body. | ||||||
| private | missing(array $args, array $values): void# |
| ||||||
| private | round(array $sources): void# |
| ||||||
| private | sanitizeRound(array $sources): void# | The arguments the reference judges once every other one passed, in its sanitize round: each may be empty, and is otherwise held to its schema; a user's password may not be empty or hold a backslash.
| ||||||
| private | password(mixed $value): ?Minn\Runtime\Refusal# | A user's password the reference will not store: empty, or holding a backslash. | ||||||
| private | refuse(array $invalid, array $details): void# | rest_invalid_param naming every refused argument, when there is one.
|
Nothing matches.