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 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
|
| Properties |
| private $defaults = ['lastLine' => 0, 'firstColumn' => 0, 'lastColumn' => 0, 'hiliteStart' => 0, 'hiliteLength' => 0, 'message' => '', 'extract' => ''] Default message values
|
| private $extract = NULL An extract of an area where the error occured
|
| private $firstColumn = NULL First column index of where the error occured
|
| private $firstLine = NULL Line number of where the error first occured
|
| private $highlightClassName = 'highlight' CSS class name to use for the highlighted substring (Only used if no custom highlighter is set)
|
| private $highlighter = NULL Callable highlighter function, overridable by user
|
| private $hiliteLength = NULL Length of highlighted string, within extract
|
| private $hiliteStart = NULL String offset within extract where the highlight should be started
|
| private $lastColumn = NULL Last column index of where the error occured
|
| private $lastLine = NULL Line number of where the error last occured
|
| private $text = NULL Text describing the error
|
| private $type = NULL Type of error
|
| Methods |
| private highlight( $str, $start, $length) Highlight the given string, enclosing it in a span
|