Documentation

TestBrowserToken extends AbstractToken
in package

A very limited token that is used to login in tests using the KernelBrowser.

Tags
author

Wouter de Jong wouter@wouterj.nl

Table of Contents

Properties

$attributes  : array<string|int, mixed>
$firewallName  : string
$roleNames  : array<string|int, mixed>
$user  : mixed

Methods

__construct()  : mixed
__serialize()  : array<string|int, mixed>
Returns all the necessary state of the object for serialization purposes.
__toString()  : string
Returns a string representation of the Token.
__unserialize()  : void
Restores the object state from an array given by __serialize().
eraseCredentials()  : mixed
Removes sensitive information from the token.
getAttribute()  : mixed
getAttributes()  : array<string|int, mixed>
getCredentials()  : mixed
getFirewallName()  : string
getRoleNames()  : array<string|int, string>
Returns the user roles.
getUser()  : UserInterface|null
Returns a user representation.
getUserIdentifier()  : string
Returns the user identifier used during authentication (e.g. a user's email address or username).
hasAttribute()  : bool
setAttribute()  : mixed
setAttributes()  : mixed
setUser()  : mixed
Sets the authenticated user in the token.

Properties

$attributes

private array<string|int, mixed> $attributes = []

Methods

__construct()

public __construct([array<string|int, mixed> $roles = [] ][, UserInterface $user = null ][, string $firewallName = 'main' ]) : mixed
Parameters
$roles : array<string|int, mixed> = []

An array of roles

$user : UserInterface = null
$firewallName : string = 'main'

__serialize()

Returns all the necessary state of the object for serialization purposes.

public __serialize() : array<string|int, mixed>

There is no need to serialize any entry, they should be returned as-is. If you extend this method, keep in mind you MUST guarantee parent data is present in the state. Here is an example of how to extend this method: public function __serialize(): array { return [$this->childAttribute, parent::__serialize()]; }

Return values
array<string|int, mixed>

__toString()

Returns a string representation of the Token.

public __toString() : string

This is only to be used for debugging purposes.

Return values
string

__unserialize()

Restores the object state from an array given by __serialize().

public __unserialize(array<string|int, mixed> $data) : void

There is no need to unserialize any entry in $data, they are already ready-to-use. If you extend this method, keep in mind you MUST pass the parent data to its respective class. Here is an example of how to extend this method: public function __unserialize(array $data): void { [$this->childAttribute, $parentData] = $data; parent::__unserialize($parentData); }

Parameters
$data : array<string|int, mixed>

eraseCredentials()

Removes sensitive information from the token.

public eraseCredentials() : mixed

getAttribute()

public getAttribute(string $name) : mixed
Parameters
$name : string

getAttributes()

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

getFirewallName()

public getFirewallName() : string
Return values
string

getRoleNames()

Returns the user roles.

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

getUserIdentifier()

Returns the user identifier used during authentication (e.g. a user's email address or username).

public getUserIdentifier() : string
Return values
string

hasAttribute()

public hasAttribute(string $name) : bool
Parameters
$name : string
Return values
bool

setAttribute()

public setAttribute(string $name, mixed $value) : mixed
Parameters
$name : string
$value : mixed

setAttributes()

public setAttributes(array<string|int, mixed> $attributes) : mixed
Parameters
$attributes : array<string|int, mixed>

The token attributes


        
On this page

Search results