PropertyTokenLinter
in package
implements
TokenLinter
Table of Contents
Interfaces
Constants
- PROPERTY_NAME_PATTERN = '/^[-a-zA-Z][a-zA-Z0-9_-]+$/'
- VARIABLE_FORMAT = '/^--[a-zA-Z0-9_-]+$/'
- https://drafts.csswg.org/css-variables/#defining-variables
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.
- lintPropertyName() : Generator<string|int, TokenError>
- lintPropertyValue() : Generator<string|int, TokenError>
Constants
PROPERTY_NAME_PATTERN
private
mixed
PROPERTY_NAME_PATTERN
= '/^[-a-zA-Z][a-zA-Z0-9_-]+$/'
VARIABLE_FORMAT
https://drafts.csswg.org/css-variables/#defining-variables
private
mixed
VARIABLE_FORMAT
= '/^--[a-zA-Z0-9_-]+$/'
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.
lintPropertyName()
private
lintPropertyName(PropertyToken $token) : Generator<string|int, TokenError>
Parameters
- $token : PropertyToken
Return values
Generator<string|int, TokenError>lintPropertyValue()
private
lintPropertyValue(PropertyToken $token) : Generator<string|int, TokenError>
Parameters
- $token : PropertyToken