HTML Validator message
- author Espen Hovlandsdal
- copyright Copyright (c) Espen Hovlandsdal
- license http://www.opensource.org/licenses/mit-license MIT License
-
link
https:
//github. com/rexxars/html-validator
-
Implements
Stringable
Methods |
public
__construct
(
array
$info
) Constructs a new message object |
public
__toString
() :
string
Transforms message to a human-readable string
|
public
format
(
$html
=
false
) Format the message in readable format
|
public
getExtract
() Get an extract of the problematic area
|
public
getFirstColumn
() Get start column where the error occured
|
public
getFirstLine
() Get line number of first line where the error occured
|
public
getHighlightLength
() Get length of the substring to highlight
|
public
getHighlightStart
() Get index offset of substring to highlight (within extract)
|
public
getLastColumn
() Get last column where the error occured
|
public
getLastLine
() Get line number of last line where the error occured
|
public
getText
() Get a text description of the message
|
public
getType
() Get the message type for this message
|
public
setHighlightClassName
(
$className
) Set the class name to use for the highlighted span. Default: "highlight"
|
public
setHighlighter
(
$highlighter
) Set function to use for highlighting a substring within a string
|
public
toHTML
() Transforms message to a human-readable HTML string
|
Properties |
private
$defaults
Default message values
|
private
$extract
An extract of an area where the error occured
|
private
$firstColumn
First column index of where the error occured
|
private
$firstLine
Line number of where the error first occured
|
private
$highlightClassName
CSS class name to use for the highlighted substring
|
private
$highlighter
Callable highlighter function, overridable by user
|
private
$hiliteLength
Length of highlighted string, within extract
|
private
$hiliteStart
String offset within extract where the highlight should be started
|
private
$lastColumn
Last column index of where the error occured
|
private
$lastLine
Line number of where the error last occured
|
private
$text
Text describing the error
|
private
$type
Type of error
|
Methods |
private
highlight
(
$str
,
$start
,
$length
) Highlight the given string, enclosing it in a span
|