PHP Class SqlParser\TokensList

Inheritance: implements ArrayAccess
Afficher le fichier Open project: phpmyadmin/sql-parser Class Usage Examples

Méthodes publiques

Свойство Type Description
$count integer The count of tokens.
$idx integer The index of the next token to be returned.
$tokens array The array of tokens.

Méthodes publiques

Méthode Description
__construct ( array $tokens = [], integer $count ) Constructor.
add ( Token $token ) : void Adds a new token.
build ( string | Token[] | TokensList $list ) : string Builds an array of tokens by merging their raw value.
getNext ( ) : Token Gets the next token. Skips any irrelevant token (whitespaces and comments).
getNextOfType ( integer $type ) : Token Gets the next token.
getNextOfTypeAndValue ( integer $type, string $value ) : Token Gets the next token.
offsetExists ( integer $offset ) : boolean Checks if an offset was previously set.
offsetGet ( integer $offset ) : Token Gets a value from the container.
offsetSet ( integer $offset, Token $value ) : void Sets an value inside the container.
offsetUnset ( integer $offset ) : void Unsets the value of an offset.

Method Details

__construct() public méthode

Constructor.
public __construct ( array $tokens = [], integer $count )
$tokens array The initial array of tokens.
$count integer The count of tokens in the initial array.

add() public méthode

Adds a new token.
public add ( Token $token ) : void
$token Token Token to be added in list.
Résultat void

build() public static méthode

Builds an array of tokens by merging their raw value.
public static build ( string | Token[] | TokensList $list ) : string
$list string | Token[] | TokensList The tokens to be built.
Résultat string

getNext() public méthode

Gets the next token. Skips any irrelevant token (whitespaces and comments).
public getNext ( ) : Token
Résultat Token

getNextOfType() public méthode

Gets the next token.
public getNextOfType ( integer $type ) : Token
$type integer The type.
Résultat Token

getNextOfTypeAndValue() public méthode

Gets the next token.
public getNextOfTypeAndValue ( integer $type, string $value ) : Token
$type integer The type of the token.
$value string The value of the token.
Résultat Token

offsetExists() public méthode

Checks if an offset was previously set.
public offsetExists ( integer $offset ) : boolean
$offset integer The offset to be checked.
Résultat boolean

offsetGet() public méthode

Gets a value from the container.
public offsetGet ( integer $offset ) : Token
$offset integer The offset to be returned.
Résultat Token

offsetSet() public méthode

Sets an value inside the container.
public offsetSet ( integer $offset, Token $value ) : void
$offset integer The offset to be set.
$value Token The token to be saved.
Résultat void

offsetUnset() public méthode

Unsets the value of an offset.
public offsetUnset ( integer $offset ) : void
$offset integer The offset to be unset.
Résultat void

Property Details

$count public_oe property

The count of tokens.
public int $count
Résultat integer

$idx public_oe property

The index of the next token to be returned.
public int $idx
Résultat integer

$tokens public_oe property

The array of tokens.
public array $tokens
Résultat array