Std
in package
This library's standard library of named types (`priv/schema/std.dxns`, ported verbatim from `dextrin`'s own) -- common refinements like `PositiveInteger`/`NonEmptyString`, so a schema author doesn't redefine them by hand. Built the same way any consumer's own named types would be -- nothing about them is special-cased in {@see Compiler}. Deliberately excludes anything domain-specific (email, phone number, URL-shaped string): what counts as a valid one is an application decision this library shouldn't guess at.
Opt-in: pass self::registry()'s result as
Schema's compile() $baseRegistry to make
these names available to your own document.
$value = Dextrin::decode($myDxnsSource);
$registry = Std::registry();
$compiled = Schema::compile($value, $registry);
Table of Contents
Constants
- SOURCE_PATH : mixed = __DIR__ . '/../../priv/schema/std.dxns'
Methods
- registry() : Registry
- Compiles the standard library into `$baseRegistry` (a fresh {@see Registry} by default), returning its named types merged in alongside anything `$baseRegistry` already had.
- source() : string
- The standard library's own `.dxns` source.
- __construct() : mixed
Constants
SOURCE_PATH
private
mixed
SOURCE_PATH
= __DIR__ . '/../../priv/schema/std.dxns'
Methods
registry()
Compiles the standard library into `$baseRegistry` (a fresh {@see Registry} by default), returning its named types merged in alongside anything `$baseRegistry` already had.
public
static registry([Registry|null $baseRegistry = null ]) : Registry
Parameters
- $baseRegistry : Registry|null = null
Return values
Registrysource()
The standard library's own `.dxns` source.
public
static source() : string
Return values
string__construct()
private
__construct() : mixed