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

$extensionslist<ExtensionInterface>The extensions to register
$defaultslist<string>Names to enable when no selection is supplied
Calls 1
public function register(ExtensionInterface $extension): void
public function has(string $name): bool

Whether an extension is registered under that name.

Parameters

$namestring

Returns

bool
Test cases 1
Called from 1
public function defaultNames(): list<string>

The extensions enabled by default when the command line names none.

Returns

list<string>
Test cases 1
Calls 3
public function sinksOf(list<string> $names): list<SinkSpec>

The calls contributed by the named extensions, in the order they are named.

Parameters

$nameslist<string>

Returns

list<SinkSpec>

Throws

UnknownExtensionException When one of the names is not registered
Called from 1
Calls 1
public function globalsOf(list<string> $names): array<string, string>

The global variables the named extensions know the class of.

Parameters

$nameslist<string>

Returns

array<string, string>

Throws

UnknownExtensionException When one of the names is not registered
Called from 1
Calls 1
public function modelProvidersOf(list<string> $names): list<ModelProviderInterface>

Optional model providers, in enabled extension order.

Parameters

$nameslist<string>

Throws

UnknownExtensionException When one of the names is not registered
Test cases 1
Called from 1
Calls 1
public function all(): list<ExtensionInterface>

The registered extensions, in alphabetical order.

Returns

Called from 1
Calls 1

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
Other tests reaching this symbol 17

Relations§

Instantiated in 1
Method calls 4
Type declarations 6