Since: 8.4

final class TokenList implements IteratorAggregate, Countable (View source)

Properties

int $length
string $value

Methods

string|null
item(int $index)

No description

bool
contains(string $token)

No description

void
add(string ...$tokens)

No description

void
remove(string ...$tokens)

No description

bool
toggle(string $token, bool|null $force = null)

No description

bool
replace(string $token, string $newToken)

No description

bool
supports(string $token)

No description

int<0, max>
count()

Count elements of an object

TValue>|TValue[]
getIterator()

Retrieve an external iterator

Details

string|null item(int $index)

No description

Parameters

int $index

Return Value

string|null

bool contains(string $token)

No description

Parameters

string $token

Return Value

bool

void add(string ...$tokens)

No description

Parameters

string ...$tokens

Return Value

void

void remove(string ...$tokens)

No description

Parameters

string ...$tokens

Return Value

void

bool toggle(string $token, bool|null $force = null)

No description

Parameters

string $token
bool|null $force

Return Value

bool

bool replace(string $token, string $newToken)

No description

Parameters

string $token
string $newToken

Return Value

bool

bool supports(string $token)

No description

Parameters

string $token

Return Value

bool

int<0, max> count()

Count elements of an object

Return Value

int<0, max>

The custom count as an integer.

The return value is cast to an integer.

TValue>|TValue[] getIterator()

Retrieve an external iterator

Return Value

TValue>|TValue[]

An instance of an object implementing Iterator or Traversable

Exceptions

Exception