Manager
abstract class Manager
Traits
Properties
| protected Repository | $config | The configuration repository instance. |
|
| protected Closure> | $customCreators | The registered custom driver creators. |
|
| protected array<array-key, mixed> | $drivers | The array of created "drivers". |
Methods
Get the default driver name.
Get a driver instance.
Create a new driver instance.
Get the name of the manager's creator method for the given driver.
Call a custom driver creator.
Get all of the created "drivers".
Get the container instance used by the manager.
Forget all of the resolved driver instances.
Dynamically call the default driver instance.
Details
in
RebindsCallbacksToSelf at line 18
protected Closure|null
bindCallbackToSelf(Closure $callback)
Bind the provided callback to the class instance.
at line 44
__construct(Container $container)
Create a new manager instance.
at line 53
abstract string|null
getDefaultDriver()
Get the default driver name.
at line 60
mixed
driver(UnitEnum|string|null $driver = null)
Get a driver instance.
at line 92
protected mixed
createDriver(string $driver)
Create a new driver instance.
at line 113
protected string|null
getCreatorMethod(string $driver)
Get the name of the manager's creator method for the given driver.
at line 124
protected mixed
callCustomCreator(string $driver)
Call a custom driver creator.
at line 140
Manager
extend(string $driver, Closure $callback)
Register a custom driver creator Closure.
Anonymous closures run in this manager's class scope; non-static closures also receive the manager as $this.
The callback persists in the singleton's customCreators array for the worker lifetime and applies to every subsequent driver resolution.
at line 160
array
getDrivers()
Get all of the created "drivers".
at line 168
Container
getContainer()
Get the container instance used by the manager.
at line 182
Manager
setContainer(Container $container)
Set the container instance used by the manager.
Swaps the singleton's container and configuration references; per-request use races across coroutines and breaks every concurrent driver resolution through this manager.
at line 199
Manager
forgetDrivers()
Forget all of the resolved driver instances.
Clears the singleton's driver cache; concurrent coroutines may already hold references that next resolution will not share.
at line 210
mixed
__call(string $method, array $parameters)
Dynamically call the default driver instance.