class Gatekeeper

Gatekeeper.

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(array|AdapterInterface $adapter)

Constructor.

string
registerAdapterInstance(AdapterInterface $adapter)

Registers an adapter instance.

string
registerAdapterFactory(string $name, Closure $factory)

Registers an adapter factory.

string
registerAdapter(array|AdapterInterface $adapter)

Registers an adapter.

extend(array|AdapterInterface $adapter)

Registers a new adapter.

useAsDefaultAdapter(string $name)

Sets the defaut adapter name.

adapterFactory(string $name)

Creates an adapter instance using a factory.

adapter(string|null $name = null)

Returns an adapter instance.

mixed
__call(string $name, 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 82
__construct(array|AdapterInterface $adapter)

Constructor.

Parameters

array|AdapterInterface $adapter Array containing the adapter name and closure factory or an adapter instance

at line 93
protected string registerAdapterInstance(AdapterInterface $adapter)

Registers an adapter instance.

Parameters

AdapterInterface $adapter Adapter instance

Return Value

string

at line 107
protected string registerAdapterFactory(string $name, Closure $factory)

Registers an adapter factory.

Parameters

string $name Adapter name
Closure $factory Adapter factory

Return Value

string

at line 120
protected string registerAdapter(array|AdapterInterface $adapter)

Registers an adapter.

Parameters

array|AdapterInterface $adapter Array containing the adapter name and closure factory or an adapter instance

Return Value

string

at line 138
Gatekeeper extend(array|AdapterInterface $adapter)

Registers a new adapter.

Parameters

array|AdapterInterface $adapter Array containing the adapter name and closure factory or an adapter instance

Return Value

Gatekeeper

at line 151
Gatekeeper useAsDefaultAdapter(string $name)

Sets the defaut adapter name.

Parameters

string $name Adapter name

Return Value

Gatekeeper

at line 164
protected AdapterInterface adapterFactory(string $name)

Creates an adapter instance using a factory.

Parameters

string $name Adapter name

Return Value

AdapterInterface

at line 177
AdapterInterface adapter(string|null $name = null)

Returns an adapter instance.

Parameters

string|null $name Adapter name

Return Value

AdapterInterface

at line 191
mixed __call(string $name, array $arguments)

Magic shortcut to the default adapter.

Parameters

string $name 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