Formatter
class Formatter (View source)
Utilities that are used for formatting queries.
Constants
private FORMATTERS |
|
Properties
array<string,bool|string|array<int,array<string,int|string>>> | $options | The formatting options. |
|
static array<string,bool> | $shortClauses | Clauses that are usually short. |
|
static array<string,bool> | $inlineClauses | Clauses that must be inlined. |
Methods
No description
The specified formatting options are merged with the default values.
The default formatting options.
The styles used for HTML formatting.
No description
Formats a query.
Details
__construct(array $options = [])
No description
protected array
getMergedOptions(array $options)
The specified formatting options are merged with the default values.
protected array
getDefaultOptions()
The default formatting options.
protected array
getDefaultFormats()
The styles used for HTML formatting.
[$type, $flags, $span, $callback].
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, array $options = [])
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.