abstract class Application (View source)

Main communication channel with the application.

Traits

Allows adding static aliases at runtime.
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(Container $container, boolean $render_configuration_exceptions = true)

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.

static Application
make()

Make a new application instance.

boolean
isBootstrapped()

Get whether the application has been bootstrapped.

Container
container()

Get the IoC container instance.

void
bootstrap(array $config = [], boolean $run = true)

Bootstrap the application.

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

mixed|null resolve(string $key)

Resolve a dependency from the IoC container.

Parameters

string $key

Return Value

mixed|null

__construct(Container $container, boolean $render_configuration_exceptions = true)

Constructor.

Parameters

Container $container
boolean $render_configuration_exceptions

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

static Application make()

Make a new application instance.

Return Value

Application

boolean isBootstrapped()

Get whether the application has been bootstrapped.

Return Value

boolean

Container container()

Get the IoC container instance.

Return Value

Container

void bootstrap(array $config = [], boolean $run = true)

Bootstrap the application.

Parameters

array $config
boolean $run

Return Value

void