Documentation

Linter
in package

Tags
phpstan-import-type

Errors from TokenizerContext

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

$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
LintConfiguration

getTokenizer()

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
Tokenizer

lintFile()

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
throws
InvalidArgumentException
throws
RuntimeException
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
self

lintStream()

Lint a stream of tokens

protected lintStream(resource $stream) : Generator<string|int, LintError>
Parameters
$stream : resource

A valid stream resource

Tags
throws
InvalidArgumentException
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
$tokens : iterable<string|int, Token|LintError>
Return values
Generator<string|int, LintError>

An array of issues found during linting.


        
On this page

Search results