final class VersionRegistry
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Names the releases each dialect ships resources for.

The record lives in resources/version.php; every path in it is relative to the resource directory and may not climb out of it.

Methods§

public function __construct(private string|null $directory = null)

Parameters

$directorystring|nullResource directory, the package's own by default
public function resolve(string $dialect, string|null $version = null): SqlVersion

Answers the resources of one release, the dialect's default when none is named.

Parameters

$dialectstringDialect to look in
$versionstring|nullRelease tag, or null for the default

Returns

SqlVersion The release and its resources

Throws

RuntimeException When the dialect or the release is not shipped
Test cases 4
Called from 3
Calls 4
public function names(string $dialect): list<string>

Answers every release tag of a dialect, oldest first.

Parameters

$dialectstringDialect to enumerate

Returns

list<string> Release tags

Throws

RuntimeException When the dialect is not shipped
Test cases 2
Called from 3
Calls 3
public function entries(): array<string, array{default: string, versions: array<string, array{table: string, keywords: string}>}>

Reads the record of shipped releases.

Returns

array<string, array{default: string, versions: array<string, array{table: string, keywords: string}>}> Releases by dialect
Test cases 1
Called from 2
Calls 1
public function path(string $relative): string

Resolves a recorded path against the resource directory.

Parameters

$relativestringPath as the record spells it

Returns

string Absolute path

Throws

RuntimeException When the path is absolute, empty or climbs out of the directory
Test cases 3
Called from 1
Calls 4
public function directory(): string

Answers the directory the resources live in.

Returns

string Absolute path
Test cases 1
Called from 2
Calls 1

Private surface 1§

Implementation details, listed for orientation only.

private string|null $directory = null

Test cases 28§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11
Other tests reaching this symbol 17

Relations§

Instantiated in 9
Method calls 6
Type declarations 6