Token
MMO\core\helpers · 1 symbol · generated 5 Oct 2026
Token
Tokenizer.php:453A single lexed unit: either a "known" token from its domain's token list (id = the key it was registered under), or a run of plain, unrecognized text (id = TEXT_ID, i.e. isText true).
- Namespace
MMO\core\helpers- Implements
- Stringable
Index
| TEXT_ID | The id used for a plain-text run (not one of the domain's known tokens). | |
| col | ||
| domain | ||
| id | ||
| line | ||
| pos | ||
| text | ||
| is($kind) | ||
| isText() | ||
| Text($domain, $text, $line, $col, $pos) static | Build a plain-text token (TEXT_ID). | |
| __construct($domain, $id, $text, $line, $col, $pos) | ||
| __toString() |
Constants1
TEXT_ID
The id used for a plain-text run (not one of the domain's known tokens). Reuses PHP's own T_INLINE_HTML constant as a convenient distinct integer, with no other significance.
Properties6
col
- Type
- int
domain
- Type
- TokenDomain
id
- Type
- int
line
- Type
- int
pos
- Type
- int
text
- Type
- string
Methods5
is($kind)
Tokenizer.php:497| $kind | array | string | int | one or more ids and/or literal texts to match against |
| returns | bool | true if this token's id OR text matches any of $kind |
isText()
Tokenizer.php:487| returns | bool | true if this is a plain-text run rather than a recognized token |
Text($domain, $text, $line, $col, $pos)
staticTokenizer.php:482Build a plain-text token (TEXT_ID).