CRUDUI PHP API

FileLoader

File loader for $ref resolution. Port of validator-ts/src/compose/loader.ts.

$ref loads external YAML files. The compose engine never touches the filesystem directly — it goes through a FileLoader, so the shared fixtures can supply a virtual in-memory file set (the spec graph is the input; no disk needed) while production wires a real disk + YAML loader. One engine, two backends — identical semantics.

Path normalization:

  • absolute (/…) paths pass through unchanged
  • relative paths get the basepath prefix (basepath . '/' . path) The loader receives the ALREADY-normalized absolute key, so cycle detection and the fixture map key on one canonical identifier.

Table of Contents

Methods

load()  : array<string, mixed>
Load the parsed document at the canonical key, or throw NOT_FOUND.
normalize()  : string
Resolve $path against $basepath to the canonical key the map uses.

Methods

load()

Load the parsed document at the canonical key, or throw NOT_FOUND.

public load(string $key) : array<string, mixed>
Parameters
$key : string
Tags
throws
ComposeLoadError

REF_FILE_NOT_FOUND when the key is absent.

Return values
array<string, mixed>

normalize()

Resolve $path against $basepath to the canonical key the map uses.

public normalize(string $path, string $basepath) : string
Parameters
$path : string
$basepath : string
Return values
string
On this page

Search results