IndentationTokenLinter
in package
implements
TokenLinter
Table of Contents
Interfaces
Properties
Methods
- __construct() : mixed
- lint() : Generator<string|int, TokenError>
- Lints a token and returns a list of issues found.
- supports() : bool
- Checks if the linter supports the given token.
- checkIndentationCharacter() : Generator<string|int, TokenError>
- Check if the indentation character is allowed
- generateError() : Generator<string|int, TokenError>
Properties
$lintConfiguration read-only
private
LintConfiguration
$lintConfiguration
Methods
__construct()
public
__construct(LintConfiguration $lintConfiguration) : mixed
Parameters
- $lintConfiguration : LintConfiguration
lint()
Lints a token and returns a list of issues found.
public
lint(Token $token) : Generator<string|int, TokenError>
Parameters
- $token : Token
-
The token to lint.
Return values
Generator<string|int, TokenError> —A list of issues found during linting.
supports()
Checks if the linter supports the given token.
public
supports(Token $token) : bool
Parameters
- $token : Token
-
The token to check.
Return values
bool —True if the linter supports the token, false otherwise.
checkIndentationCharacter()
Check if the indentation character is allowed
private
checkIndentationCharacter(WhitespaceToken $token) : Generator<string|int, TokenError>
Parameters
- $token : WhitespaceToken
-
The token to check
Return values
Generator<string|int, TokenError> —A list of issues found during linting.
generateError()
private
generateError(WhitespaceToken $token, Position $start, Position $end, string $char) : Generator<string|int, TokenError>
Parameters
- $token : WhitespaceToken
- $start : Position
- $end : Position
- $char : string