Documentation

AliasLoader
in package

Table of Contents

$aliases  : array<string|int, mixed>
The array of class aliases.
$facadeNamespace  : string
The namespace for all real-time facades.
$instance  : AliasLoader
The singleton instance of the loader.
$registered  : bool
Indicates if a loader has been registered.
alias()  : void
Add an alias to the loader.
getAliases()  : array<string|int, mixed>
Get the registered aliases.
getInstance()  : AliasLoader
Get or create the singleton alias loader instance.
isRegistered()  : bool
Indicates if the loader has been registered.
load()  : bool|null
Load a class alias if it is registered.
register()  : void
Register the loader on the auto-loader stack.
setAliases()  : void
Set the registered aliases.
setFacadeNamespace()  : void
Set the real-time facade namespace.
setInstance()  : void
Set the value of the singleton alias loader.
setRegistered()  : void
Set the "registered" state of the loader.
ensureFacadeExists()  : string
Ensure that the given alias has an existing real-time facade class.
formatFacadeStub()  : string
Format the facade stub with the proper namespace and class.
loadFacade()  : void
Load a real-time facade for the given alias.
prependToLoaderStack()  : void
Prepend the load method to the auto-loader stack.
__clone()  : void
Clone method.
__construct()  : void
Create a new AliasLoader instance.

Properties

$aliases

The array of class aliases.

protected array<string|int, mixed> $aliases

$facadeNamespace

The namespace for all real-time facades.

protected static string $facadeNamespace = 'Facades\'

$registered

Indicates if a loader has been registered.

protected bool $registered = false

Methods

alias()

Add an alias to the loader.

public alias(string $class, string $alias) : void
Parameters
$class : string
$alias : string
Return values
void

getAliases()

Get the registered aliases.

public getAliases() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInstance()

Get or create the singleton alias loader instance.

public static getInstance([array<string|int, mixed> $aliases = [] ]) : AliasLoader
Parameters
$aliases : array<string|int, mixed> = []
Return values
AliasLoader

isRegistered()

Indicates if the loader has been registered.

public isRegistered() : bool
Return values
bool

load()

Load a class alias if it is registered.

public load(string $alias) : bool|null
Parameters
$alias : string
Return values
bool|null

register()

Register the loader on the auto-loader stack.

public register() : void
Return values
void

setAliases()

Set the registered aliases.

public setAliases(array<string|int, mixed> $aliases) : void
Parameters
$aliases : array<string|int, mixed>
Return values
void

setFacadeNamespace()

Set the real-time facade namespace.

public static setFacadeNamespace(string $namespace) : void
Parameters
$namespace : string
Return values
void

setInstance()

Set the value of the singleton alias loader.

public static setInstance(AliasLoader $loader) : void
Parameters
$loader : AliasLoader
Return values
void

setRegistered()

Set the "registered" state of the loader.

public setRegistered(bool $value) : void
Parameters
$value : bool
Return values
void

ensureFacadeExists()

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

protected ensureFacadeExists(string $alias) : string
Parameters
$alias : string
Return values
string

formatFacadeStub()

Format the facade stub with the proper namespace and class.

protected formatFacadeStub(string $alias, string $stub) : string
Parameters
$alias : string
$stub : string
Return values
string

loadFacade()

Load a real-time facade for the given alias.

protected loadFacade(string $alias) : void
Parameters
$alias : string
Return values
void

prependToLoaderStack()

Prepend the load method to the auto-loader stack.

protected prependToLoaderStack() : void
Return values
void

__clone()

Clone method.

private __clone() : void
Return values
void

__construct()

Create a new AliasLoader instance.

private __construct(array<string|int, mixed> $aliases) : void
Parameters
$aliases : array<string|int, mixed>
Return values
void

Search results