classSchemaRegistry
final class SchemaRegistry
Stores CREATE TABLE definitions keyed by table name.
Methods§
public function register(string $tableName, string $createTableSql): voidRegister or replace a CREATE TABLE statement.
Parameters
$tableName | string | |
$createTableSql | string |
Test cases 4
SchemaRegistryTest::testClearLeavesTheRegistryWithNoTablesAtAllcovers and callsSchemaRegistryTest::testHasAnswersForATableTheRegistryKnowscovers and callsSchemaRegistryTest::testHasAnyTablesIsFalseUntilOneIsRegisteredcovers and callsSchemaRegistryTest::testUnregisterLeavesTheRegistryWithoutThatTablecovers and calls
public function get(string $tableName): ?stringReturn a CREATE TABLE statement when present.
Parameters
$tableName | string |
Returns
?stringTest cases 1
SchemaRegistryTest::testUnregisterLeavesTheRegistryWithoutThatTablecovers and calls
public function has(string $tableName): boolCheck whether a table is explicitly registered.
Parameters
$tableName | string |
Returns
boolTest cases 1
SchemaRegistryTest::testHasAnswersForATableTheRegistryKnowscovers and calls
public function getAll(): array<string, string>Return all registered CREATE TABLE statements.
Returns
array<string, string>Test cases 1
SchemaRegistryTest::testClearLeavesTheRegistryWithNoTablesAtAllcovers and calls
public function hasAnyTables(): boolCheck whether at least one table is registered.
Returns
boolTest cases 2
SchemaRegistryTest::testClearLeavesTheRegistryWithNoTablesAtAllcovers and callsSchemaRegistryTest::testHasAnyTablesIsFalseUntilOneIsRegisteredcovers and calls
public function clear(): voidRemove all registered tables.
Test cases 1
SchemaRegistryTest::testClearLeavesTheRegistryWithNoTablesAtAllcovers and calls
public function unregister(string $tableName): voidRemove a registered table.
Parameters
$tableName | string |
Test cases 1
SchemaRegistryTest::testUnregisterLeavesTheRegistryWithoutThatTablecovers and calls
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
SchemaRegistryTest::testClearLeavesTheRegistryWithNoTablesAtAllcovers and callsSchemaRegistryTest::testHasAnswersForATableTheRegistryKnowscovers and callsSchemaRegistryTest::testHasAnyTablesIsFalseUntilOneIsRegisteredcovers and callsSchemaRegistryTest::testUnregisterLeavesTheRegistryWithoutThatTablecovers and calls