classResourceWriter
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())public function writeTable(SqlVersion $version, ParseTable $table): voidWrites the parse table of a release.
Parameters
$version | SqlVersion | The release |
$table | ParseTable | Its table |
Throws
RuntimeException When the file cannot be writtenTest cases 1
Calls 2
- method-call ResourceWriter::ensureDirectory() line 35
- method-call TableFile::save() line 36
public function writeKeywords(
SqlVersion $version,
array<string, array<string, string>> $keywords,
string $origin,
): voidWrites the keyword table of a release as a PHP file returning an array.
Parameters
$version | SqlVersion | The release |
$keywords | array<string, array<string, string>> | Terminal name by spelling, by group |
$origin | string | Where the keywords were read from |
Throws
RuntimeException When the file cannot be writtenTest cases 1
Calls 4
- method-call ResourceWriter::ensureDirectory() line 50
- method-call ResourceWriter::export() line 51
- function-call
file_put_contentsline 52 - new
RuntimeExceptionline 53
public function export(array<string, array<string, string>|string> $values, int $indent): stringRenders a nested array of strings as PHP source, one entry per line.
Parameters
$values | array<string, array<string, string>|string> | Values to render |
$indent | int | Nesting depth |
Returns
string PHP source of the arrayTest cases 1
Called from 2
public function ensureDirectory(string $path): voidMakes sure the directory of a path exists.
Parameters
$path | string | File about to be written |
Throws
RuntimeException When the directory cannot be madeTest cases 1
Called from 2
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.