LintContext
in package
Tags
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
= ''
$lintContextName
Current context name of parsing
private
LintContextName|null
$lintContextName
= null
$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
selfappendCurrentContent()
Append new value to context content
public
appendCurrentContent(string $currentContent) : self
Parameters
- $currentContent : string
Return values
selfassertCurrentContext()
Assert that current context is the same as given
public
assertCurrentContext(LintContextName|null $lintContextName) : bool
Parameters
- $lintContextName : LintContextName|null
Return values
boolassertPreviousChar()
Assert that previous char is the same as given
public
assertPreviousChar(string $charValue) : bool
Parameters
- $charValue : string
Return values
booldecrementNestedSelector()
Decrement the nested selector level
public
decrementNestedSelector() : void
getCurrentContent()
Return context content
public
getCurrentContent() : string
Return values
stringgetCurrentContext()
public
getCurrentContext() : LintContextName|null
Return values
LintContextName|nullgetErrors()
Return the errors occurred during the lint process
public
getErrors() : Errors
Return values
ErrorsincrementCharNumber()
Add 1 to the current char number
public
incrementCharNumber() : self
Return values
selfincrementLineNumber()
Add 1 to the current line number
public
incrementLineNumber() : self
Return values
selfincrementNestedSelector()
Increase the nested selector level
public
incrementNestedSelector() : void
isComment()
Tells if the linter is parsing a comment
public
isComment() : bool
Return values
boolisNestedSelector()
Tells if the linter is parsing a nested selector
public
isNestedSelector() : bool
Return values
boolresetCharNumber()
Reset current char number property
public
resetCharNumber() : self
Return values
selfresetCurrentContext()
Reset context property
public
resetCurrentContext() : self
Return values
selfsetComment()
Set the comment flag
public
setComment(bool $comment) : void
Parameters
- $comment : bool
setCurrentContext()
Set new context
public
setCurrentContext(LintContextName|null $lintContextName) : self
Parameters
- $lintContextName : LintContextName|null
Return values
selfsetPreviousChar()
Set new previous char
public
setPreviousChar(string $charValue) : self
Parameters
- $charValue : string