API / Minn\Rest / SiteSchema

SiteSchema final class

Minn\Rest\SiteSchema · public/minn/src/Minn/Rest/SiteSchema.php · 38 lines

The site's JSON-schema handler: one Schema whose email test, number formatter and string-format sanitizers carry the filters plugins hook (is_email, number_format_i18n, the sanitizers), and the answers the REST helpers give with it (true or a list of errors).

Constants and properties

privatestatic ?Minn\Rest\Schema $schema

Public

staticget(): Minn\Rest\Schema#

The site's schema handler.

staticvalidate(mixed $value, mixed $args, mixed $param = ''): mixed#

Whether a value fits a schema (rest_validate_value_from_schema): true, or the errors saying why not.

staticsanitize(mixed $value, mixed $args, mixed $param = ''): mixed#

A value made to fit a schema (rest_sanitize_value_from_schema).

staticresult(Minn\Runtime\Refusal|true $result): mixed#

True, or the list of errors a refusal reads as.