*/ 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 ParseException( 'TokenList cannot be converted to a ComponentValueList' ); $ex->parseErrors = $parser->getParseErrors(); throw $ex; } return $ret->toComponentValueArray(); } }