Token final readonly class
Minn\Html\Tree\Token · public/minn/src/Minn/Html/Tree/Token.php · 45 lines
A token as the tree builder reads it: a tag (name upper-cased), a run of text (one kind at a time: NUL bytes, white space, or anything else), a comment-like leaf, or the end of the input.
Constants and properties
| const | CLOSER = 1 | |
| const | SELF_CLOSING = 2 | |
| prop | readonly string $type | Promoted from the constructor. |
| prop | readonly string $name | Promoted from the constructor. |
| prop | readonly int $flags | Promoted from the constructor. |
| prop | readonly int $offset | Promoted from the constructor. |
| prop | readonly string $text | Promoted from the constructor. |
| prop | readonly string $kind | Promoted from the constructor. |
Public
| new | __construct(string $type, string $name, int $flags, int $offset, string $text = '', string $kind = '')# | |
| method | isStart(string ...$names): bool# | Whether this is a start tag with one of the names (any name when none are given). |
| method | isEnd(string ...$names): bool# | Whether this is an end tag with one of the names (any name when none are given). |
| method | selfClosing(): bool# | Whether the tag was written with "/>". |
| method | isText(string $kind): bool# | Whether this is a run of text of the kind ("null", "whitespace", "generic"). |
| method | renamed(string $name, int $flags): self# | The same token under another name (an "image" start tag read as "img", "</br>" as "<br>"). |
Nothing matches.