TokenError
extends LintError
in package
Table of Contents
Methods
- __construct() : mixed
- Constructor for the Error class.
- __toString() : string
- Convert the error to a string representation.
- fromTokenizerContext() : self
- getEnd() : Position
- Get the end position of the lint error.
- getKey() : LintErrorKey
- Get the key of the lint error.
- getMessage() : string
- Get the message of the lint error.
- getStart() : Position
- Get the start position of the lint error.
- jsonSerialize() : SerializedLintError
- Serialize the error to JSON.
Methods
__construct()
Constructor for the Error class.
public
__construct(LintErrorKey $key, string $message, Token $token[, Position|null $start = null ][, Position|null $end = null ]) : mixed
Parameters
- $key : LintErrorKey
- $message : string
-
The error message.
- $token : Token
-
The token associated with the error.
- $start : Position|null = null
- $end : Position|null = null
__toString()
Convert the error to a string representation.
public
__toString() : string
Return values
stringfromTokenizerContext()
public
static fromTokenizerContext(LintErrorKey $key, string $message, TokenizerContext $tokenizerContext) : self
Parameters
- $key : LintErrorKey
- $message : string
- $tokenizerContext : TokenizerContext
Return values
selfgetEnd()
Get the end position of the lint error.
public
getEnd() : Position
Return values
PositiongetKey()
Get the key of the lint error.
public
getKey() : LintErrorKey
Return values
LintErrorKeygetMessage()
Get the message of the lint error.
public
getMessage() : string
Return values
stringgetStart()
Get the start position of the lint error.
public
getStart() : Position
Return values
PositionjsonSerialize()
Serialize the error to JSON.
public
jsonSerialize() : SerializedLintError