PHP 클래스 SqlParser\Utils\Formatter

파일 보기 프로젝트 열기: phpmyadmin/sql-parser 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$INLINE_CLAUSES array These clauses usually are short and it's nicer to have them inline.
$options array The formatting options.

공개 메소드들

메소드 설명
__construct ( array $options = [] ) Constructor.
escapeConsole ( $string )
format ( string $query, array $options = [] ) : string Formats a query.
formatList ( TokensList $list ) : string Formats the given list of tokens.
getGroupLength ( TokensList $list ) : integer Computes the length of a group.
isClause ( Token $token ) : integer | boolean Checks if a token is a statement or a clause inside a statement.
toString ( Token $token ) : string Tries to print the query and returns the result.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $options = [] )
$options array The formatting options.

escapeConsole() 공개 메소드

public escapeConsole ( $string )

format() 공개 정적인 메소드

Formats a query.
public static format ( string $query, array $options = [] ) : string
$query string The query to be formatted
$options array The formatting options.
리턴 string The formatted string.

formatList() 공개 메소드

Formats the given list of tokens.
public formatList ( TokensList $list ) : string
$list SqlParser\TokensList The list of tokens.
리턴 string

getGroupLength() 공개 정적인 메소드

A group is delimited by a pair of brackets.
public static getGroupLength ( TokensList $list ) : integer
$list SqlParser\TokensList The list of tokens.
리턴 integer

isClause() 공개 정적인 메소드

Checks if a token is a statement or a clause inside a statement.
public static isClause ( Token $token ) : integer | boolean
$token SqlParser\Token The token to be checked.
리턴 integer | boolean

toString() 공개 메소드

Tries to print the query and returns the result.
public toString ( Token $token ) : string
$token SqlParser\Token The token to be printed.
리턴 string

프로퍼티 상세

$INLINE_CLAUSES 공개적으로 정적으로 프로퍼티

These clauses usually are short and it's nicer to have them inline.
public static array $INLINE_CLAUSES
리턴 array

$options 공개적으로 프로퍼티

The formatting options.
public array $options
리턴 array