classExtensionRegistry
final class ExtensionRegistry
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
The extensions available to a run, and the calls they contribute.
Methods§
public function __construct(
list<ExtensionInterface> $extensions = [],
private list<string> $defaults = [],
)Parameters
$extensions | list<ExtensionInterface> | The extensions to register |
$defaults | list<string> | Names to enable when no selection is supplied |
Calls 1
- method-call ExtensionRegistry::register() line 26
public function register(ExtensionInterface $extension): voidAdds an extension, replacing any registered under the same name.
Parameters
$extension | ExtensionInterface |
Test cases 1
Called from 1
Calls 1
- method-call ExtensionInterface::name() line 35
public function names(): list<string>The registered names, in alphabetical order.
Returns
list<string>Test cases 2
Called from 2
public function has(string $name): boolWhether an extension is registered under that name.
Parameters
$name | string |
Returns
boolTest cases 1
public function get(string $name): ExtensionInterfaceThe extension registered under that name.
Parameters
$name | string |
Returns
Throws
UnknownExtensionException When nothing is registered under the nameTest cases 2
Called from 3
- method-call SqlCatalog\Core\Extension\ExtensionRegistry::sinksOf() packages/sql-catalog/src/Core/Extension/ExtensionRegistry.php:93
- method-call SqlCatalog\Core\Extension\ExtensionRegistry::globalsOf() packages/sql-catalog/src/Core/Extension/ExtensionRegistry.php:112
- method-call SqlCatalog\Core\Extension\ExtensionRegistry::modelProvidersOf() packages/sql-catalog/src/Core/Extension/ExtensionRegistry.php:131
Calls 2
- new UnknownExtensionException line 66
- method-call ExtensionRegistry::names() line 66
public function defaultNames(): list<string>The extensions enabled by default when the command line names none.
Returns
list<string>Calls 3
- function-call
array_valuesline 76 - function-call
array_filterline 76 - method-call ExtensionRegistry::has() line 78
public function sinksOf(list<string> $names): list<SinkSpec>The calls contributed by the named extensions, in the order they are named.
Parameters
$names | list<string> |
Returns
list<SinkSpec>Throws
UnknownExtensionException When one of the names is not registeredCalled from 1
Calls 1
- method-call ExtensionRegistry::get() line 93
public function globalsOf(list<string> $names): array<string, string>The global variables the named extensions know the class of.
Parameters
$names | list<string> |
Returns
array<string, string>Throws
UnknownExtensionException When one of the names is not registeredCalled from 1
Calls 1
- method-call ExtensionRegistry::get() line 112
public function modelProvidersOf(list<string> $names): list<ModelProviderInterface>Optional model providers, in enabled extension order.
Parameters
$names | list<string> |
Returns
list<ModelProviderInterface>Throws
UnknownExtensionException When one of the names is not registeredTest cases 1
Called from 1
Calls 1
- method-call ExtensionRegistry::get() line 131
public function all(): list<ExtensionInterface>The registered extensions, in alphabetical order.
Returns
list<ExtensionInterface>Called from 1
Calls 1
- method-call ExtensionRegistry::names() line 148
Private surface 2§
Implementation details, listed for orientation only.
private array<string, ExtensionInterface> $extensions = []private list<string> $defaults = []Test cases 23§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
ExtensionRegistryTest::testDefaultNamesAreTheDriverExtensionsThatAreRegisteredcallsExtensionRegistryTest::testGetAnswersWithTheRegisteredExtensioncallsExtensionRegistryTest::testGetRefusesAnUnknownNamecallsExtensionRegistryTest::testHasReportsWhetherAnExtensionIsRegisteredcallsExtensionRegistryTest::testNamesAreAlphabeticalcallsExtensionRegistryTest::testRegisterReplacesAnExtensionOfTheSameNamecalls
Other tests reaching this symbol 17
CatalogCommandTestcallsUsageTextTestcallsCallEvaluatorTestcallsExpressionEvaluatorTestcallsInterpreterTestcallsSinkMatcherTestcallsModelProviderInterfaceTest::testModelsCanBeProvidedOutsideTheBuiltinscallsCallModelTestcallsAnalyzerTest::testAnalyzeSourceAcceptsAnApplicationSqlPolicycallsAnalyzerTest::testAnalyzeSourceAllowsExtensionsToModelSqlFragmentsFromAnyCallFormcallsAnalyzerTest::testAnalyzeSourceKeepsAModelledSinkWithoutARegisteredCompilerVisiblecallsAnalyzerTest::testAnalyzeSourceLetsRegisteredCallModelsOwnTheirArgumentEffectscallsAnalyzerTest::testAnalyzeSourceSupportsRegisteredQueryModelsWithoutLaravelcallsAnalyzerTest::testExtensionsAreTheOnesTheRunCanAskForcallsBuiltinsTestcallsJsonReporterTestcallsTextReporterTestcalls
Relations§
Instantiated in 1
Method calls 4
- method-call SqlCatalog\Cli\UsageText::extensions() packages/sql-catalog/src/Cli/UsageText.php:80
- method-call SqlCatalog\Facade\Analyzer::entriesOf() packages/sql-catalog/src/Facade/Analyzer.php:158
- method-call SqlCatalog\Facade\Analyzer::entriesOf() packages/sql-catalog/src/Facade/Analyzer.php:163
- method-call SqlCatalog\Facade\Analyzer::entriesOf() packages/sql-catalog/src/Facade/Analyzer.php:166
Type declarations 6
- type SqlCatalog\Cli\UsageText packages/sql-catalog/src/Cli/UsageText.php:17
- type SqlCatalog\Cli\UsageText packages/sql-catalog/src/Cli/UsageText.php:24
- type SqlCatalog\Facade\Analyzer packages/sql-catalog/src/Facade/Analyzer.php:50
- type SqlCatalog\Facade\Analyzer packages/sql-catalog/src/Facade/Analyzer.php:62
- type SqlCatalog\Facade\Analyzer packages/sql-catalog/src/Facade/Analyzer.php:86
- type SqlCatalog\Facade\Builtins packages/sql-catalog/src/Facade/Builtins.php:26