Copied!

HTML Validator message

Cloneable Instantiable
Methods
public __construct ( array $info )
 

Constructs a new message object

public __toString () : string
 

Transforms message to a human-readable string

  • return string
public format ( $html = false )
 

Format the message in readable format

  • return string
public getExtract ()
 

Get an extract of the problematic area

  • return string
public getFirstColumn ()
 

Get start column where the error occured

  • return int
public getFirstLine ()
 

Get line number of first line where the error occured

  • return int
public getHighlightLength ()
 

Get length of the substring to highlight

  • return int
public getHighlightStart ()
 

Get index offset of substring to highlight (within extract)

  • return int
public getLastColumn ()
 

Get last column where the error occured

  • return int
public getLastLine ()
 

Get line number of last line where the error occured

  • return int
public getText ()
 

Get a text description of the message

  • return string
public getType ()
 

Get the message type for this message

  • return string
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
Callable arguments:
(string) $string - The full string in which to find the substring
(int) $start - Start index of the substring to highlight
(int) $length - Length of substring to highlight

public toHTML ()
 

Transforms message to a human-readable HTML string

  • return string
Properties
private $defaults
 

Default message values

  • var array
private $extract
 

An extract of an area where the error occured

  • var string
private $firstColumn
 

First column index of where the error occured

  • var int
private $firstLine
 

Line number of where the error first occured

  • var int
private $highlightClassName
 

CSS class name to use for the highlighted substring
(Only used if no custom highlighter is set)

  • var string
private $highlighter
 

Callable highlighter function, overridable by user

  • var callable
private $hiliteLength
 

Length of highlighted string, within extract

  • var int
private $hiliteStart
 

String offset within extract where the highlight should be started

  • var int
private $lastColumn
 

Last column index of where the error occured

  • var int
private $lastLine
 

Line number of where the error last occured

  • var int
private $text
 

Text describing the error

  • var string
private $type
 

Type of error

  • var string
Methods
private highlight ( $str , $start , $length )
 

Highlight the given string, enclosing it in a span

  • return string
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only