final class SchemaRegistry

Stores CREATE TABLE definitions keyed by table name.

Methods§

public function register(string $tableName, string $createTableSql): void

Register or replace a CREATE TABLE statement.

Parameters

$tableNamestring
$createTableSqlstring
Test cases 4
public function get(string $tableName): ?string

Return a CREATE TABLE statement when present.

Parameters

$tableNamestring

Returns

?string
Test cases 1
public function has(string $tableName): bool

Check whether a table is explicitly registered.

Parameters

$tableNamestring

Returns

bool
Test cases 1
public function getAll(): array<string, string>

Return all registered CREATE TABLE statements.

Returns

array<string, string>
Test cases 1
public function hasAnyTables(): bool

Check whether at least one table is registered.

Returns

bool
Test cases 2
public function clear(): void

Remove all registered tables.

Test cases 1
public function unregister(string $tableName): void

Remove a registered table.

Parameters

$tableNamestring
Test cases 1

Private surface 1§

Implementation details, listed for orientation only.

private array<string, string> $schemas = []

Test cases 4§

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

Dedicated tests 4