php-dextrin

FileResolver
in package

FinalYes

An optional convenience resolver ({@see Registry::putResolver()}) resolving `Namespace/Name` references to `.dxns` files on disk.

Composing multiple compiled schemas into one registry needs no special mechanism at all -- Compiler's $baseRegistry parameter threads across repeated calls. What genuinely needs a policy decision is automatically resolving a bare Namespace/Name reference to a file path, and this class is one reasonable, swappable answer to that -- not a mandated convention baked into Registry/Schema itself. Anyone with a different convention writes their own resolver closure directly against Registry::putResolver(); this class exists only because the convention below is a common, unsurprising default.

Convention: Namespace/Name resolves to <searchPath>/Namespace.dxns, read for the specific entry named Name -- a .dxns file is already a map of possibly-many schema names, so "Namespace" names the file, "Name" one schema defined inside it. A bare reference with no / (Name) resolves to <searchPath>/Name.dxns, read for the entry also named Name.

Table of Contents

Methods

forPaths()  : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 callable(string): Array
Builds a resolver searching `$searchPaths` in order, returning the first match. `$predicates` is forwarded to {@see Compiler::compile()} for any `refine-fn:` the loaded files use.
__construct()  : mixed
resolveIn()  : Compiled|null
splitName()  : array{0: string, 1: string}

Methods

forPaths()

Builds a resolver searching `$searchPaths` in order, returning the first match. `$predicates` is forwarded to {@see Compiler::compile()} for any `refine-fn:` the loaded files use.

public static forPaths(array<int, string> $searchPaths[, Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 array<string, callable(array<string, mixed>): Array> $predicates = [] ]) : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 callable(string): Array
Parameters
$searchPaths : array<int, string>
$predicates : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 array<string, callable(array<string, mixed>): Array> = []
Return values
Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 callable(string): Array

resolveIn()

private static resolveIn(string $dir, string $fileStem, string $entryName, Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 array<string, callable(array<string, mixed>): Array> $predicates) : Compiled|null
Parameters
$dir : string
$fileStem : string
$entryName : string
$predicates : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 array<string, callable(array<string, mixed>): Array>
Return values
Compiled|null

splitName()

private static splitName(string $name) : array{0: string, 1: string}
Parameters
$name : string
Return values
array{0: string, 1: string}
On this page

Search results