ArgCheck final readonly class
Minn\Rest\ArgCheck · public/minn/src/Minn/Rest/ArgCheck.php · 85 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. 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 3
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# |
|
Nothing matches.