PHP Class Latte\TokenIterator

Inheritance: use trait latte\Strict
Datei anzeigen Open project: nette/latte

Public Properties

Property Type Description
$ignored array
$position integer
$tokens array

Public Methods

Method Description
__construct ( array $tokens )
currentToken ( ) : array | null Returns current token.
currentValue ( ) : string | null Returns current token value.
expectNextValue ( ) : string Returns next expected token or throws exception.
isCurrent ( $arg ) : boolean Checks the current token.
isNext ( ) : boolean Checks the next token existence.
isPrev ( ) : boolean Checks the previous token existence.
joinAll ( ) : string Returns concatenation of all next token values.
joinUntil ( $arg ) : string Returns concatenation of all next tokens until it sees a given token type or value.
nextAll ( ) : array[] Returns all next tokens.
nextToken ( ) : array | null Returns next token.
nextUntil ( $arg ) : array[] Returns all next tokens until it sees a given token type or value.
nextValue ( ) : string | null Returns next token value.
reset ( ) : static

Protected Methods

Method Description
next ( ) Moves cursor to next token.
scan ( $wanted, $onlyFirst, $advance, $strings = FALSE, $until = FALSE, $prev = FALSE ) : mixed Looks for (first) (not) wanted tokens.

Method Details

__construct() public method

public __construct ( array $tokens )
$tokens array

currentToken() public method

Returns current token.
public currentToken ( ) : array | null
return array | null

currentValue() public method

Returns current token value.
public currentValue ( ) : string | null
return string | null

expectNextValue() public method

Returns next expected token or throws exception.
public expectNextValue ( ) : string
return string

isCurrent() public method

Checks the current token.
public isCurrent ( $arg ) : boolean
return boolean

isNext() public method

Checks the next token existence.
public isNext ( ) : boolean
return boolean

isPrev() public method

Checks the previous token existence.
public isPrev ( ) : boolean
return boolean

joinAll() public method

Returns concatenation of all next token values.
public joinAll ( ) : string
return string

joinUntil() public method

Returns concatenation of all next tokens until it sees a given token type or value.
public joinUntil ( $arg ) : string
return string

next() protected method

Moves cursor to next token.
protected next ( )

nextAll() public method

Returns all next tokens.
public nextAll ( ) : array[]
return array[]

nextToken() public method

Returns next token.
public nextToken ( ) : array | null
return array | null

nextUntil() public method

Returns all next tokens until it sees a given token type or value.
public nextUntil ( $arg ) : array[]
return array[]

nextValue() public method

Returns next token value.
public nextValue ( ) : string | null
return string | null

reset() public method

public reset ( ) : static
return static

scan() protected method

Looks for (first) (not) wanted tokens.
protected scan ( $wanted, $onlyFirst, $advance, $strings = FALSE, $until = FALSE, $prev = FALSE ) : mixed
return mixed

Property Details

$ignored public_oe property

public array $ignored
return array

$position public_oe property

public int $position
return integer

$tokens public_oe property

public array $tokens
return array