Linter
in package
Tags
Table of Contents
Properties
- $lintConfiguration : LintConfiguration|null
- Class to provide css properties knowledge
- $tokenizer : Tokenizer|null
- Class to provide css tokenizer
Methods
- __construct() : mixed
- Constructor
- getLintConfiguration() : LintConfiguration
- Return an instance of the "\CssLint\Properties" helper, initialize a new one if not define already
- getTokenizer() : Tokenizer
- Returns an instance of a tokenizer.
- lintFile() : Generator<string|int, LintError>
- Performs lint for a given file path
- lintString() : Generator<string|int, LintError>
- Performs lint on a given string
- setLintConfiguration() : self
- Set an instance of the "\CssLint\Properties" helper
- setTokenizer() : Linter
- Sets an instance of a tokenizer.
- lintStream() : Generator<string|int, LintError>
- Lint a stream of tokens
- lintToken() : Generator<string|int, LintError>
- Lint a token
- lintTokens() : Generator<string|int, LintError>
- Lint a list of tokens or errors
Properties
$lintConfiguration
Class to provide css properties knowledge
protected
LintConfiguration|null
$lintConfiguration
$tokenizer
Class to provide css tokenizer
protected
Tokenizer|null
$tokenizer
Methods
__construct()
Constructor
public
__construct([LintConfiguration $lintConfiguration = null ][, Tokenizer|null $tokenizer = null ]) : mixed
Parameters
- $lintConfiguration : LintConfiguration = null
-
An instance of the LintConfiguration class to provide css properties knowledge
- $tokenizer : Tokenizer|null = null
getLintConfiguration()
Return an instance of the "\CssLint\Properties" helper, initialize a new one if not define already
public
getLintConfiguration() : LintConfiguration
Return values
LintConfigurationgetTokenizer()
Returns an instance of a tokenizer.
public
getTokenizer() : Tokenizer
You may need to adjust the class name and constructor as per your project structure.
Return values
TokenizerlintFile()
Performs lint for a given file path
public
lintFile(string $filePath) : Generator<string|int, LintError>
Parameters
- $filePath : string
-
A path of an existing and readable file
Tags
Return values
Generator<string|int, LintError> —An array of issues found during linting.
lintString()
Performs lint on a given string
public
lintString(string $stringValue) : Generator<string|int, LintError>
Parameters
- $stringValue : string
Return values
Generator<string|int, LintError> —An array of issues found during linting.
setLintConfiguration()
Set an instance of the "\CssLint\Properties" helper
public
setLintConfiguration(LintConfiguration $lintConfiguration) : self
Parameters
- $lintConfiguration : LintConfiguration
Return values
selfsetTokenizer()
Sets an instance of a tokenizer.
public
setTokenizer(Tokenizer $tokenizer) : Linter
Parameters
- $tokenizer : Tokenizer
Return values
LinterlintStream()
Lint a stream of tokens
protected
lintStream(resource $stream) : Generator<string|int, LintError>
Parameters
- $stream : resource
-
A valid stream resource
Tags
Return values
Generator<string|int, LintError> —An array of issues found during linting.
lintToken()
Lint a token
private
lintToken(Token $token) : Generator<string|int, LintError>
Parameters
- $token : Token
Return values
Generator<string|int, LintError> —An array of issues found during linting.
lintTokens()
Lint a list of tokens or errors
private
lintTokens(iterable<string|int, Token|LintError> $tokens) : Generator<string|int, LintError>
Parameters
Return values
Generator<string|int, LintError> —An array of issues found during linting.