Copied!

HTML Validator message

CloneableInstantiable
Methods
public __construct(array $info)
 

Constructs a new message object

  • param array $info
public __toString() : string
 

Transforms message to a human-readable string

  • return string
public format( $html = false)
 

Format the message in readable format

  • param bool $html Whether to return an HTML-representation or not
  • 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"

  • param string $className Valid CSS class name
  • return \Message
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

  • param callable $highlighter
  • throws \Exception
  • return \Message
public toHTML()
 

Transforms message to a human-readable HTML string

  • return string
Properties
private $defaults = ['lastLine' => 0, 'firstColumn' => 0, 'lastColumn' => 0, 'hiliteStart' => 0, 'hiliteLength' => 0, 'message' => '', 'extract' => '']
 

Default message values

  • var array
private $extract = NULL
 

An extract of an area where the error occured

  • var string
private $firstColumn = NULL
 

First column index of where the error occured

  • var int
private $firstLine = NULL
 

Line number of where the error first occured

  • var int
private $highlightClassName = 'highlight'
 

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

  • var string
private $highlighter = NULL
 

Callable highlighter function, overridable by user

  • var callable
private $hiliteLength = NULL
 

Length of highlighted string, within extract

  • var int
private $hiliteStart = NULL
 

String offset within extract where the highlight should be started

  • var int
private $lastColumn = NULL
 

Last column index of where the error occured

  • var int
private $lastLine = NULL
 

Line number of where the error last occured

  • var int
private $text = NULL
 

Text describing the error

  • var string
private $type = NULL
 

Type of error

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

Highlight the given string, enclosing it in a span

  • param string $str String to highlight
  • param int $start Start index of substring to highlight
  • param int $length Length of substring to highlight
  • return string
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration