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

Resolves supported releases and their generated grammar AST paths. Lexical definitions for these same releases are reviewed PHP declarations.

Methods§

public function resolve(string $dialect, string|null $version = null): SqlVersion

Answers the artifacts generated for one release, defaulting to the newest the dialect ships.

Parameters

$dialectstringDialect the caller generates SQL for
$versionstring|nullRelease to resolve, or null for the dialect default

Returns

SqlVersion Artifacts committed for that release

Throws

RuntimeException When the dialect or the release is not one this package ships
Test cases 4
Called from 2
Calls 4
public function names(string $dialect): list<string>

Answers every release one dialect ships, oldest first.

Parameters

$dialectstringDialect to enumerate

Returns

list<string> Release names in the order they were registered

Throws

RuntimeException When the dialect is not one this package ships
Test cases 3
Called from 2
Calls 3
public function all(): list<SqlVersion>

Answers every release of every dialect, so a caller can act on all of them.

Returns

list<SqlVersion> Artifacts committed for each registered release

Throws

RuntimeException When the record names a release it does not describe
Test cases 1
Called from 1
Calls 4
public function path(string $relativePath): string

Resolves an artifact path recorded in the registry against the resource directory.

The record is data the package reads at runtime, so a path that escapes the resource directory would let it load a file the package never generated. Only relative paths that stay inside are accepted.

Parameters

$relativePathstringPath as the registry records it

Returns

string Absolute path of the artifact

Throws

RuntimeException When the path is absolute, empty, or climbs out of the resource directory
Test cases 4
Called from 1
Calls 4

Test cases 30§

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

Dedicated tests 10
Other tests reaching this symbol 20

Relations§

Instantiated in 3
Method calls 3