trait HasStaticAliasesTrait (View source)

Allows adding static aliases at runtime.

Traits

Add methods to classes at runtime.

Methods

void
alias(string $alias, string|Closure $target)

Register an alias.

boolean
hasAlias(string $alias)

Get whether an alias is registered.

__call($method, $parameters)

No description

mixed|null
resolve(string $key)

Resolve a dependency from the IoC container.

__construct()

Constructor.

array
registerInstance(array $instances)

Register the current instance.

static mixed
__callStatic(string $method, array $parameters)

Invoke any matching alias when a static method is used.

Details

void alias(string $alias, string|Closure $target)

Register an alias.

Parameters

string $alias
string|Closure $target

Return Value

void

boolean hasAlias(string $alias)

Get whether an alias is registered.

Parameters

string $alias

Return Value

boolean

__call($method, $parameters)

Parameters

$method
$parameters

abstract mixed|null resolve(string $key)

Resolve a dependency from the IoC container.

Parameters

string $key

Return Value

mixed|null

__construct()

Constructor.

array registerInstance(array $instances)

Register the current instance.

Parameters

array $instances object> $instances

Return Value

array object>

static mixed __callStatic(string $method, array $parameters)

Invoke any matching alias when a static method is used.

Parameters

string $method
array $parameters

Return Value

mixed