class AliasLoader

Properties

protected array $aliases

The array of class aliases.

protected bool $registered

Indicates if a loader has been registered.

static protected string $facadeNamespace

The namespace for all real-time facades.

static protected AliasLoader $instance

The singleton instance of the loader.

Methods

static AliasLoader
getInstance(array $aliases = [])

Get or create the singleton alias loader instance.

bool|null
load(string $alias)

Load a class alias if it is registered.

void
loadFacade(string $alias)

Load a real-time facade for the given alias.

string
ensureFacadeExists(string $alias)

Ensure that the given alias has an existing real-time facade class.

string
formatFacadeStub(string $alias, string $stub)

Format the facade stub with the proper namespace and class.

void
alias(string $class, string $alias)

Add an alias to the loader.

void
register()

Register the loader on the auto-loader stack.

void
prependToLoaderStack()

Prepend the load method to the auto-loader stack.

array
getAliases()

Get the registered aliases.

void
setAliases(array $aliases)

Set the registered aliases.

bool
isRegistered()

Indicates if the loader has been registered.

void
setRegistered(bool $value)

Set the "registered" state of the loader.

static void
setFacadeNamespace(string $namespace)

Set the real-time facade namespace.

static void
setInstance(AliasLoader $loader)

Set the value of the singleton alias loader.

Details

at line 51
static AliasLoader getInstance(array $aliases = [])

Get or create the singleton alias loader instance.

Parameters

array $aliases

Return Value

AliasLoader

at line 70
bool|null load(string $alias)

Load a class alias if it is registered.

Parameters

string $alias

Return Value

bool|null

at line 89
protected void loadFacade(string $alias)

Load a real-time facade for the given alias.

Parameters

string $alias

Return Value

void

at line 100
protected string ensureFacadeExists(string $alias)

Ensure that the given alias has an existing real-time facade class.

Parameters

string $alias

Return Value

string

at line 120
protected string formatFacadeStub(string $alias, string $stub)

Format the facade stub with the proper namespace and class.

Parameters

string $alias
string $stub

Return Value

string

at line 140
void alias(string $class, string $alias)

Add an alias to the loader.

Parameters

string $class
string $alias

Return Value

void

at line 150
void register()

Register the loader on the auto-loader stack.

Return Value

void

at line 164
protected void prependToLoaderStack()

Prepend the load method to the auto-loader stack.

Return Value

void

at line 174
array getAliases()

Get the registered aliases.

Return Value

array

at line 185
void setAliases(array $aliases)

Set the registered aliases.

Parameters

array $aliases

Return Value

void

at line 195
bool isRegistered()

Indicates if the loader has been registered.

Return Value

bool

at line 206
void setRegistered(bool $value)

Set the "registered" state of the loader.

Parameters

bool $value

Return Value

void

at line 217
static void setFacadeNamespace(string $namespace)

Set the real-time facade namespace.

Parameters

string $namespace

Return Value

void

at line 228
static void setInstance(AliasLoader $loader)

Set the value of the singleton alias loader.

Parameters

AliasLoader $loader

Return Value

void