class PhpSourceToken implements StringRepresentation, ArrayAccess, ArrayRepresentation (View source)

"Polyfill" of the PHP 8 PhpToken class

Methods

__construct($token, $index)

Token descriptor given by token_get_all()

string
__toString()

No description

array
getArrayCopy()

No description

number
getTokenIndex()

No description

string
getTokenName()

No description

integer
getTokenType()

No description

string
getTokenValue()

No description

integer
getTokenLine()

No description

boolean
is(int|string|array $kind)

No description

boolean
isIgnorable()

No description

offsetGet($offset)

No description

offsetExists($offset)

No description

offsetUnset($offset)

No description

offsetSet($offset, $value)

No description

Details

__construct($token, $index)

Token descriptor given by token_get_all()

Parameters

$token
$index

string __toString()

Return Value

string The string representation of the class instance

array getArrayCopy()

Return Value

array Array representation of the class instance

number getTokenIndex()

Return Value

number

string getTokenName()

Return Value

string Token type name

integer getTokenType()

Return Value

integer Token type ID

string getTokenValue()

Return Value

string Token textual content

integer getTokenLine()

Return Value

integer Token line number

boolean is(int|string|array $kind)

Parameters

int|string|array $kind

Return Value

boolean

See also

https://www.php.net/manual/en/phptoken.is.php

boolean isIgnorable()

offsetGet($offset)

Parameters

$offset

offsetExists($offset)

Parameters

$offset

offsetUnset($offset)

Parameters

$offset

offsetSet($offset, $value)

Parameters

$offset
$value