AtRuleTokenLinter
in package
implements
TokenLinter
Table of Contents
Interfaces
Properties
- $AT_RULE_CHARSET : string
- $AT_RULE_IMPORT : string
- $AT_RULE_LAYER : string
- $AT_RULE_LAYER_NAME_PATTERN : string
- $lintConfiguration : LintConfiguration
Methods
- __construct() : mixed
- lint() : Generator<string|int, LintError>
- Lints a token and returns a list of issues found.
- supports() : bool
- isValidImportConditions() : bool
- isValidImportUrl() : bool
- validateCharsetRule() : Generator<string|int, TokenError>
- validateImportRule() : Generator<string|int, TokenError>
- validateLayerRule() : Generator<string|int, TokenError>
Properties
$AT_RULE_CHARSET
private
static string
$AT_RULE_CHARSET
= 'charset'
$AT_RULE_IMPORT
private
static string
$AT_RULE_IMPORT
= 'import'
$AT_RULE_LAYER
private
static string
$AT_RULE_LAYER
= 'layer'
$AT_RULE_LAYER_NAME_PATTERN
private
static string
$AT_RULE_LAYER_NAME_PATTERN
= '/^[a-zA-Z0-9-_,\s]+$/'
$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, LintError>
Parameters
- $token : Token
Return values
Generator<string|int, LintError> —A list of issues found during linting.
supports()
public
supports(Token $token) : bool
Parameters
- $token : Token
Return values
boolisValidImportConditions()
private
isValidImportConditions(string $conditions) : bool
Parameters
- $conditions : string
Return values
boolisValidImportUrl()
private
isValidImportUrl(string $url) : bool
Parameters
- $url : string
Return values
boolvalidateCharsetRule()
private
validateCharsetRule(AtRuleToken $token) : Generator<string|int, TokenError>
Parameters
- $token : AtRuleToken
Return values
Generator<string|int, TokenError>validateImportRule()
private
validateImportRule(AtRuleToken $token) : Generator<string|int, TokenError>
Parameters
- $token : AtRuleToken
Return values
Generator<string|int, TokenError>validateLayerRule()
private
validateLayerRule(AtRuleToken $token) : Generator<string|int, TokenError>
Parameters
- $token : AtRuleToken