Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4096842
TokenGeneratorHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
TokenGeneratorHandler.php
View Options
<?php
namespace
Wikimedia\RemexHtml\Tokenizer
;
/**
* The handler which converts events to tokens arrays for TokenGenerator
*/
class
TokenGeneratorHandler
implements
TokenHandler
{
public
$tokens
=
[];
public
function
startDocument
(
Tokenizer
$tokenizer
,
$fragmentNamespace
,
$fragmentName
)
{
$this
->
tokens
[]
=
[
'type'
=>
'startDocument'
,
'fragmentNamespace'
=>
$fragmentNamespace
,
'fragmentName'
=>
$fragmentName
];
}
public
function
endDocument
(
$pos
)
{
$this
->
tokens
[]
=
[
'type'
=>
'endDocument'
];
}
public
function
error
(
$text
,
$pos
)
{
$this
->
tokens
[]
=
[
'type'
=>
'error'
,
'text'
=>
$text
,
'sourceStart'
=>
$pos
];
}
public
function
characters
(
$text
,
$start
,
$length
,
$sourceStart
,
$sourceLength
)
{
$this
->
tokens
[]
=
[
'type'
=>
'text'
,
'text'
=>
$text
,
'start'
=>
$start
,
'length'
=>
$length
,
'sourceStart'
=>
$sourceStart
,
'sourceLength'
=>
$sourceLength
];
}
public
function
startTag
(
$name
,
Attributes
$attrs
,
$selfClose
,
$sourceStart
,
$sourceLength
)
{
$this
->
tokens
[]
=
[
'type'
=>
'startTag'
,
'name'
=>
$name
,
'attrs'
=>
$attrs
,
'selfClose'
=>
$selfClose
,
'sourceStart'
=>
$sourceStart
,
'sourceLength'
=>
$sourceLength
];
}
public
function
endTag
(
$name
,
$sourceStart
,
$sourceLength
)
{
$this
->
tokens
[]
=
[
'type'
=>
'endTag'
,
'name'
=>
$name
,
'sourceStart'
=>
$sourceStart
,
'sourceLength'
=>
$sourceLength
];
}
public
function
doctype
(
$name
,
$public
,
$system
,
$quirks
,
$sourceStart
,
$sourceLength
)
{
$this
->
tokens
[]
=
[
'type'
=>
'doctype'
,
'name'
=>
$name
,
'public'
=>
$public
,
'system'
=>
$system
,
'quirks'
=>
$quirks
];
}
public
function
comment
(
$text
,
$sourceStart
,
$sourceLength
)
{
$this
->
tokens
[]
=
[
'type'
=>
'comment'
,
'text'
=>
$text
,
'sourceStart'
=>
$sourceStart
,
'sourceLength'
=>
$sourceLength
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 14:32 (3 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6e/12/1786667bde82285f7670ef69a35d
Default Alt Text
TokenGeneratorHandler.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment