Linna Csrf Guard

ProviderSimpleFactory
in package

Csrf token provider factory.

The fastest way to obtain a CSRF token Provider.

Table of Contents

getProvider()  : TokenProviderInterface
Create a Csrf token provider.

Methods

getProvider()

Create a Csrf token provider.

public static getProvider([class-string $provider = SynchronizerTokenProvider::class ][, array<int|string, mixed> $options = [] ]) : TokenProviderInterface
Parameters
$provider : class-string = SynchronizerTokenProvider::class

The token provider for which we need an instance.

$options : array<int|string, mixed> = []

Specific options for the token provider as associative array.

Tags
throws
InvalidArgumentException

If the passed provider isn't a valid token provider.

throws
RuntimeException

If the creation of the token provider instance fails.

Return values
TokenProviderInterface

The token provider instance.

Search results