Documentation

SqlFormatter
in package

FinalYes

Table of Contents

Properties

$highlighter  : Highlighter
$tokenizer  : Tokenizer

Methods

__construct()  : mixed
compress()  : string
Compress a query by collapsing white space and removing comments
format()  : string
Format the whitespace in a SQL string to make it easier to read.
highlight()  : string
Add syntax highlighting to a SQL string

Properties

Methods

compress()

Compress a query by collapsing white space and removing comments

public compress(string $string) : string
Parameters
$string : string

The SQL string

Return values
string

The SQL string without comments

format()

Format the whitespace in a SQL string to make it easier to read.

public format(string $string[, string $indentString = ' ' ]) : string
Parameters
$string : string

The SQL string

$indentString : string = ' '
Return values
string

The SQL string with HTML styles and formatting wrapped in a

 tag

highlight()

Add syntax highlighting to a SQL string

public highlight(string $string) : string
Parameters
$string : string

The SQL string

Return values
string

The SQL string with HTML styles applied


        
On this page

Search results