DebugUtils
in package
Contains functions that aid in debugging and are generally useful to developers.
Table of Contents
Methods
- highlightJson() : string
- Highlights a well-formed JSON string as HTML.
- highlightSql() : string
- Highlights a SQL string as HTML.
- trimIndent() : string
- Trims excess indentation off a string.
Methods
highlightJson()
Highlights a well-formed JSON string as HTML.
public
static highlightJson(string $string) : string
Parameters
- $string : string
-
Well-formed JSON.
Return values
string —Highlighted JSON.
highlightSql()
Highlights a SQL string as HTML.
public
static highlightSql(string $string) : string
Parameters
- $string : string
-
SQL.
Return values
string —Highlighted SQL.
trimIndent()
Trims excess indentation off a string.
public
static trimIndent(string $string) : string
Example: If both the first and the third lines are indented thrice but the second one has four indents, the returned string will have three less indents, where only the second line has any indentation left.
Ignores lines with no leading whitrespace.
Parameters
- $string : string
-
Query with indentation to remove.
Return values
string —Query without excess indentation.