ParamCheck final class
Minn\Rest\ParamCheck · public/minn/src/Minn/Rest/ParamCheck.php · 76 lines
The required / validate / sanitize pass over a request's declared arguments. The callbacks are plugin code and may answer with a WP_Error; the caller hands them in already normalised to true, false, or [message, details].
Uses 1
Public
| static | validate(array $args, callable $param, callable $validate): ?Minn\Runtime\Refusal# | The first refusal among the request's parameters, or null when all pass.
| |||||||||
| static | sanitize(array $params, array $args, callable $sanitize): array# | The parameters after sanitising, or the refusal listing every invalid one.
@return array{0: array<string, array<string, mixed>>, 1: Refusal|null} the parameters after sanitising, and the refusal if any failed |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | refusal(array $invalid, array $details): ?Minn\Runtime\Refusal# |
Nothing matches.