Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4155854
TokenList.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
TokenList.php
View Options
<?php
/**
* @file
* @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
*/
namespace
Wikimedia\CSS\Objects
;
use
UnexpectedValueException
;
use
Wikimedia\CSS\Parser\Parser
;
/**
* Represent a list of CSS tokens
*/
class
TokenList
extends
CSSObjectList
{
/**
* @var string
*/
protected
static
$objectType
=
Token
::
class
;
/** @var Token[] The objects contained */
protected
$objects
;
/** @inheritDoc */
public
function
toTokenArray
()
{
// We can greatly simplify this, assuming no separator
return
$this
->
objects
;
}
/** @inheritDoc */
public
function
toComponentValueArray
()
{
// This one, though, is complicated
$parser
=
Parser
::
newFromTokens
(
$this
->
objects
);
$ret
=
$parser
->
parseComponentValueList
();
if
(
$parser
->
getParseErrors
()
)
{
$ex
=
new
UnexpectedValueException
(
'TokenList cannot be converted to a ComponentValueList'
);
// @phan-suppress-next-line PhanUndeclaredProperty
$ex
->
parseErrors
=
$parser
->
getParseErrors
();
throw
$ex
;
}
return
$ret
->
toComponentValueArray
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 21:58 (8 w, 10 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
23/21/b5501724af4c524d0e43aebd372e
Default Alt Text
TokenList.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment