Skip to content

QueueDriverRegistry

Process-global registry mapping short driver aliases (e.g.

“sync”, “db”) to the QueueDriverInterface class that implements them, so queue.default_driver/--driver can say db instead of a fully-qualified class name. Mirrors DatabaseDriverRegistry exactly.

Only sync ships in core. Persistent backends register their own alias from their plugin (e.g. quioteframework/queue-db’s QueueDbPlugin).

final class QueueDriverRegistry

SourceQueueDriverRegistry.php
MethodDescription
aliases(): array<string, class-string<QueueDriverInterface>>
has(string $alias): boolWhether $alias has been registered.
instantiateClassFor(string $aliasOrClass): stringResolves an alias or class name to a loadable QueueDriverInterface implementation and returns its class name — nothing is instantiated here.
register(string $alias, class-string<QueueDriverInterface> $driverClass): void
reset(): voidTest isolation: restore the built-in aliases only.
resolve(string $aliasOrClass): stringA string that is not a registered alias is returned unchanged, so a fully-qualified class name passes through.

public static function aliases(): array<string, class-string<QueueDriverInterface>>

Returns array``<``string``, ``class-string``<QueueDriverInterface>``>

public static function has(string $alias): bool

Whether $alias has been registered.

Only tests the alias table; a fully-qualified class name that QueueDriverRegistry::resolve() would happily pass through is not an alias and reports false here.

ParameterTypeDescription
$aliasstring

Returns bool

public static function instantiateClassFor(string $aliasOrClass): string

Resolves an alias or class name to a loadable QueueDriverInterface implementation and returns its class name — nothing is instantiated here.

ParameterTypeDescription
$aliasOrClassstring

Returns string

ThrowsWhen
RuntimeExceptionif the resolved class does not exist (the message distinguishes a registered alias whose package is missing from an unknown alias), or exists but does not implement QueueDriverInterface.

public static function register(string $alias, class-string<QueueDriverInterface> $driverClass): void

ParameterTypeDescription
$aliasstring
$driverClassclass-string``<QueueDriverInterface>

public static function reset(): void

Test isolation: restore the built-in aliases only.

public static function resolve(string $aliasOrClass): string

A string that is not a registered alias is returned unchanged, so a fully-qualified class name passes through.

ParameterTypeDescription
$aliasOrClassstring

Returns string