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

Writes the generated resources of one release where the registry expects them.

Methods§

public function __construct(private TableFile $tables = new \SqlParser\Table\TableFile())

Parameters

$tablesTableFileStores parse tables
Calls 1
public function writeTable(SqlVersion $version, ParseTable $table): void

Writes the parse table of a release.

Parameters

$versionSqlVersionThe release
$tableParseTableIts table

Throws

RuntimeException When the file cannot be written
Test cases 1
Calls 2
public function writeKeywords(
    SqlVersion $version,
    array<string, array<string, string>> $keywords,
    string $origin,
): void

Writes the keyword table of a release as a PHP file returning an array.

Parameters

$versionSqlVersionThe release
$keywordsarray<string, array<string, string>>Terminal name by spelling, by group
$originstringWhere the keywords were read from

Throws

RuntimeException When the file cannot be written
Test cases 1
Calls 4
public function export(array<string, array<string, string>|string> $values, int $indent): string

Renders a nested array of strings as PHP source, one entry per line.

Parameters

$valuesarray<string, array<string, string>|string>Values to render
$indentintNesting depth

Returns

string PHP source of the array
Test cases 1
Called from 2
Calls 5
public function ensureDirectory(string $path): void

Makes sure the directory of a path exists.

Parameters

$pathstringFile about to be written

Throws

RuntimeException When the directory cannot be made
Test cases 1
Called from 2
Calls 4

Private surface 1§

Implementation details, listed for orientation only.

private TableFile $tables = new \SqlParser\Table\TableFile()

Test cases 4§

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

Dedicated tests 4