class Authentication

Authentication.

Constants

LOGIN_BANNED

Status code for banned users.

LOGIN_ACTIVATING

Status code for users who need to activate their account.

LOGIN_INCORRECT

Status code for users who fail to provide the correct credentials.

LOGIN_LOCKED

Status code for users that are temporarily locked.

Properties

protected string $defaultAdapter Default adapter name.
protected array $adapters Adapters.
protected array $adapterFactories Adapter factories.

Methods

__construct(string|AdapterInterface $adapter, Closure $factory = null)

Constructor.

registerAdapter(string|AdapterInterface $adapter, Closure $factory = null, bool $makeDefault = false)

Registers a adapter.

extend(string|AdapterInterface $adapter, Closure $factory = null)

Registers a new adapter.

useAsDefaultAdapter(string $name)

Sets the defaut adapter name.

resolveAdapter(string $name)

Resolves a adapter instance.

adapter(string $name = null)

Returns a adapter instance.

mixed
__call(string $method, array $arguments)

Magic shortcut to the default adapter.

string
getName()

No description

void
setUserRepository(UserRepositoryInterface $userRepository)

No description

void
setUser(UserEntityInterface $user)

No description

UserEntityInterface|null
getUser()

No description

bool
isGuest()

No description

bool
isLoggedIn()

No description

Details

at line 83
__construct(string|AdapterInterface $adapter, Closure $factory = null)

Constructor.

Parameters

string|AdapterInterface $adapter Adapter name or adapter instance
Closure $factory Adapter factory

at line 95
protected registerAdapter(string|AdapterInterface $adapter, Closure $factory = null, bool $makeDefault = false)

Registers a adapter.

Parameters

string|AdapterInterface $adapter Adapter name or adapter instance
Closure $factory Adapter factory
bool $makeDefault Make it the default adapter?

at line 119
Authentication extend(string|AdapterInterface $adapter, Closure $factory = null)

Registers a new adapter.

Parameters

string|AdapterInterface $adapter Adapter name or adapter instance
Closure $factory Adapter factory

Return Value

Authentication

at line 132
Authentication useAsDefaultAdapter(string $name)

Sets the defaut adapter name.

Parameters

string $name Adapter name

Return Value

Authentication

at line 145
protected AdapterInterface resolveAdapter(string $name)

Resolves a adapter instance.

Parameters

string $name Adapter name

Return Value

AdapterInterface

at line 158
AdapterInterface adapter(string $name = null)

Returns a adapter instance.

Parameters

string $name Adapter name

Return Value

AdapterInterface

at line 172
mixed __call(string $method, array $arguments)

Magic shortcut to the default adapter.

Parameters

string $method Method name
array $arguments Method arguments

Return Value

mixed

at line 26
string getName()

Return Value

string

at line 26
void setUserRepository(UserRepositoryInterface $userRepository)

Parameters

UserRepositoryInterface $userRepository

Return Value

void

at line 26
UserRepositoryInterface getUserRepository()

at line 26
void setUser(UserEntityInterface $user)

Parameters

UserEntityInterface $user

Return Value

void

at line 26
UserEntityInterface|null getUser()

Return Value

UserEntityInterface|null

at line 26
bool isGuest()

Return Value

bool

at line 26
bool isLoggedIn()

Return Value

bool