Formatter
class Formatter (View source)
Utilities that are used for formatting queries.
Constants
| private FORMATTERS |
|
Properties
| static array<string, bool> | $shortClauses | Clauses that are usually short. |
|
| static array<string, bool> | $inlineClauses | Clauses that must be inlined. |
Methods
Details
protected
__construct(FormattingOptions $options = new FormattingOptions())
No description
string
formatList(TokensList $list)
Formats the given list of tokens.
string
escapeConsole(string $string)
No description
string
toString(Token $token)
Tries to print the query and returns the result.
static string
format(string $query, FormattingOptions $options = new FormattingOptions())
Formats a query.
static int
getGroupLength(TokensList $list)
Computes the length of a group.
A group is delimited by a pair of brackets.
static int|false
isClause(Token $token)
Checks if a token is a statement or a clause inside a statement.