Symfony2 API
Class

Symfony\Component\CssSelector\TokenStream

class TokenStream

TokenStream represents a stream of CSS Selector tokens.

This component is a port of the Python lxml library,
which is copyright Infrae and distributed under the BSD license.

Methods

__construct(array $tokens, mixed $source = null)

Constructor.

array getUsed()

Gets the tokens that have already been visited in this stream.

mixed next()

Gets the next token in the stream or null if there is none.

mixed peek()

Peeks for the next token in this stream.

Details

at line 36
public __construct(array $tokens, mixed $source = null)

Constructor.

Parameters

array $tokens The tokens that make the stream.
mixed $source The source of the stream.

at line 50
public array getUsed()

Gets the tokens that have already been visited in this stream.

Return Value

array

at line 62
public mixed next()

Gets the next token in the stream or null if there is none.

Note that if this stream was set to be peeking its behavior
will be restored to not peeking after this operation.

Return Value

mixed

at line 91
public mixed peek()

Peeks for the next token in this stream.

This means that the next token
will be returned but it won't be considered as used (visited) until the
next() method is invoked.
If there are no remaining tokens null will be returned.

Return Value

mixed

See also

next()