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).
Synopsis
Section titled “Synopsis”final class QueueDriverRegistry
| Source | QueueDriverRegistry.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
aliases(): array<string, class-string<QueueDriverInterface>> | |
has(string $alias): bool | Whether $alias has been registered. |
instantiateClassFor(string $aliasOrClass): string | Resolves 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(): void | Test isolation: restore the built-in aliases only. |
resolve(string $aliasOrClass): string | A string that is not a registered alias is returned unchanged, so a fully-qualified class name passes through. |
aliases()
Section titled “aliases()”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.
| Parameter | Type | Description |
|---|---|---|
$alias | string |
Returns bool
instantiateClassFor()
Section titled “instantiateClassFor()”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.
| Parameter | Type | Description |
|---|---|---|
$aliasOrClass | string |
Returns string
| Throws | When |
|---|---|
RuntimeException | if 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. |
register()
Section titled “register()”public static function register(string $alias, class-string<QueueDriverInterface> $driverClass): void
| Parameter | Type | Description |
|---|---|---|
$alias | string | |
$driverClass | class-string``<QueueDriverInterface> |
reset()
Section titled “reset()”public static function reset(): void
Test isolation: restore the built-in aliases only.
resolve()
Section titled “resolve()”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.
| Parameter | Type | Description |
|---|---|---|
$aliasOrClass | string |
Returns string