HtmlHighlighter
in package
implements
Highlighter
FinalYes
Table of Contents
Interfaces
Constants
- HIGHLIGHT_PRE = 'pre'
Properties
- $htmlAttributes : array<string, string>
- $usePre : bool
- This flag tells us if queries need to be enclosed in <pre> tags
Methods
- __construct() : mixed
- attributes() : string|null
- highlightError() : string
- Highlights a token which causes an issue
- highlightErrorMessage() : string
- Highlights an error message
- highlightToken() : string
- Highlights a token depending on its type.
- output() : string
- Helper function for building string output
Constants
HIGHLIGHT_PRE
public
mixed
HIGHLIGHT_PRE
= 'pre'
Properties
$htmlAttributes
private
array<string, string>
$htmlAttributes
$usePre
This flag tells us if queries need to be enclosed in <pre> tags
private
bool
$usePre
Methods
__construct()
public
__construct([array<string, string> $htmlAttributes = [] ][, bool $usePre = true ]) : mixed
Parameters
- $htmlAttributes : array<string, string> = []
- $usePre : bool = true
attributes()
public
attributes(int $type) : string|null
Parameters
- $type : int
Return values
string|nullhighlightError()
Highlights a token which causes an issue
public
highlightError(string $value) : string
Parameters
- $value : string
Return values
stringhighlightErrorMessage()
Highlights an error message
public
highlightErrorMessage(string $value) : string
Parameters
- $value : string
Return values
stringhighlightToken()
Highlights a token depending on its type.
public
highlightToken(int $type, string $value) : string
Parameters
- $type : int
- $value : string
Return values
stringoutput()
Helper function for building string output
public
output(string $string) : string
Parameters
- $string : string
-
The string to be quoted
Return values
string —The quoted string