Documentation

LintContext
in package

Tags
phpstan-type

Errors array

phpstan-type

ContextEntry string|null

phpstan-type

Context ContextEntry|ContextEntry[]

Table of Contents

Properties

$charNumber  : int
Current char number
$errors  : Errors
Errors occurred during the lint process
$lineNumber  : int
Current line number
$comment  : bool
Tells if the linter is parsing a comment
$currentContent  : string
Current content of parse. Ex: the selector name, the property name or the property content
$lintContextName  : LintContextName|null
Current context name of parsing
$nestedSelectorLevel  : int
Tells if the linter is parsing a nested selector. Ex: @media, @keyframes.
$previousChar  : string|null
The previous linted char

Methods

addError()  : self
Add a new error message to the errors property, it adds extra infos to the given error message
appendCurrentContent()  : self
Append new value to context content
assertCurrentContext()  : bool
Assert that current context is the same as given
assertPreviousChar()  : bool
Assert that previous char is the same as given
decrementNestedSelector()  : void
Decrement the nested selector level
getCurrentContent()  : string
Return context content
getCurrentContext()  : LintContextName|null
getErrors()  : Errors
Return the errors occurred during the lint process
incrementCharNumber()  : self
Add 1 to the current char number
incrementLineNumber()  : self
Add 1 to the current line number
incrementNestedSelector()  : void
Increase the nested selector level
isComment()  : bool
Tells if the linter is parsing a comment
isNestedSelector()  : bool
Tells if the linter is parsing a nested selector
resetCharNumber()  : self
Reset current char number property
resetCurrentContext()  : self
Reset context property
setComment()  : void
Set the comment flag
setCurrentContext()  : self
Set new context
setPreviousChar()  : self
Set new previous char

Properties

$charNumber

Current char number

protected int $charNumber = 0

$errors

Errors occurred during the lint process

protected Errors $errors = []

$lineNumber

Current line number

protected int $lineNumber = 0

$comment

Tells if the linter is parsing a comment

private bool $comment = false

$currentContent

Current content of parse. Ex: the selector name, the property name or the property content

private string $currentContent = ''

$nestedSelectorLevel

Tells if the linter is parsing a nested selector. Ex: @media, @keyframes.

private int $nestedSelectorLevel = 0

..

$previousChar

The previous linted char

private string|null $previousChar = null

Methods

addError()

Add a new error message to the errors property, it adds extra infos to the given error message

public addError(string $error) : self
Parameters
$error : string
Return values
self

appendCurrentContent()

Append new value to context content

public appendCurrentContent(string $currentContent) : self
Parameters
$currentContent : string
Return values
self

assertCurrentContext()

Assert that current context is the same as given

public assertCurrentContext(LintContextName|null $lintContextName) : bool
Parameters
$lintContextName : LintContextName|null
Return values
bool

assertPreviousChar()

Assert that previous char is the same as given

public assertPreviousChar(string $charValue) : bool
Parameters
$charValue : string
Return values
bool

decrementNestedSelector()

Decrement the nested selector level

public decrementNestedSelector() : void

getCurrentContent()

Return context content

public getCurrentContent() : string
Return values
string

getErrors()

Return the errors occurred during the lint process

public getErrors() : Errors
Return values
Errors

incrementCharNumber()

Add 1 to the current char number

public incrementCharNumber() : self
Return values
self

incrementLineNumber()

Add 1 to the current line number

public incrementLineNumber() : self
Return values
self

incrementNestedSelector()

Increase the nested selector level

public incrementNestedSelector() : void

isComment()

Tells if the linter is parsing a comment

public isComment() : bool
Return values
bool

isNestedSelector()

Tells if the linter is parsing a nested selector

public isNestedSelector() : bool
Return values
bool

resetCharNumber()

Reset current char number property

public resetCharNumber() : self
Return values
self

resetCurrentContext()

Reset context property

public resetCurrentContext() : self
Return values
self

setComment()

Set the comment flag

public setComment(bool $comment) : void
Parameters
$comment : bool

setPreviousChar()

Set new previous char

public setPreviousChar(string $charValue) : self
Parameters
$charValue : string
Return values
self

        
On this page

Search results