Represents a Token.
More...
Represents a Token.
- Author
- Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Definition at line 18 of file Token.php.
__construct |
( |
|
$type, |
|
|
|
$value, |
|
|
|
$lineno |
|
) |
| |
Constructor.
- Parameters
-
integer | $type | The type of the token |
string | $value | The token value |
integer | $lineno | The line position in the source |
Definition at line 45 of file Token.php.
Returns a string representation of the token.
- Returns
- string A string representation of the token
Definition at line 57 of file Token.php.
Gets the line.
- Returns
- integer The source line
Definition at line 94 of file Token.php.
Gets the token type.
- Returns
- integer The token type
Definition at line 104 of file Token.php.
Gets the token value.
- Returns
- string The token value
Definition at line 114 of file Token.php.
test |
( |
|
$type, |
|
|
|
$values = null |
|
) |
| |
Tests the current token for a type and/or a value.
Parameters may be:
- just type
- type and value (or array of possible values)
- just value (or array of possible values) (NAME_TYPE is used as type)
- Parameters
-
array | integer | $type | The type to test |
array | string | null | $values | The token value |
- Returns
- Boolean
Definition at line 75 of file Token.php.
static typeToEnglish |
( |
|
$type, |
|
|
|
$line = -1 |
|
) |
| |
|
static |
Returns the english representation of a given type.
- Parameters
-
integer | $type | The type as an integer |
integer | $line | The code line |
- Returns
- string The string representation
Definition at line 185 of file Token.php.
static typeToString |
( |
|
$type, |
|
|
|
$short = false , |
|
|
|
$line = -1 |
|
) |
| |
|
static |
Returns the constant representation (internal) of a given type.
- Parameters
-
integer | $type | The type as an integer |
Boolean | $short | Whether to return a short representation or not |
integer | $line | The code line |
- Returns
- string The string representation
Definition at line 128 of file Token.php.
const BLOCK_START_TYPE = 1 |
const INTERPOLATION_END_TYPE = 11 |
const INTERPOLATION_START_TYPE = 10 |
const PUNCTUATION_TYPE = 9 |
The documentation for this class was generated from the following file: