css-sanitizer
Classes to parse and sanitize CSS
Loading...
Searching...
No Matches
Wikimedia\CSS\Grammar\FunctionMatcher Class Reference

Matcher that matches a CSSFunction. More...

+ Inheritance diagram for Wikimedia\CSS\Grammar\FunctionMatcher:
+ Collaboration diagram for Wikimedia\CSS\Grammar\FunctionMatcher:

Public Member Functions

 __construct ( $name, Matcher $matcher)
 
- Public Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
 capture ( $captureName)
 Return a copy of this matcher that will capture its matches.
 
 matchAgainst (ComponentValueList $values, array $options=[])
 Match against a list of ComponentValues.
 
 getDefaultOptions ()
 Fetch the default options for this Matcher.
 
 setDefaultOptions (array $options)
 Set the default options for this Matcher.
 

Protected Member Functions

 generateMatches (ComponentValueList $values, $start, array $options)
 @inheritDoc
 
- Protected Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
 next (ComponentValueList $values, $start, array $options)
 Find the next ComponentValue in the input, possibly skipping whitespace.
 
 makeMatch (ComponentValueList $list, $start, $end, GrammarMatch $submatch=null, array $stack=[])
 Create a GrammarMatch.
 

Protected Attributes

 $nameCheck
 
 $matcher
 
- Protected Attributes inherited from Wikimedia\CSS\Grammar\Matcher
 $captureName = null
 
 $defaultOptions
 

Additional Inherited Members

- Static Public Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
static create (... $args)
 Create an instance.
 

Detailed Description

Matcher that matches a CSSFunction.

The grammar definitions in the standards seem to be written assuming they're being passed a sequence of Tokens only, even though they're defined over a sequence of ComponentValues (which includes SimpleBlocks and CSSFunctions) instead.

Thus, to be safe you'll want to use this when a grammar specifies something like ‘FUNCTION <stuff> ’)'`.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\CSS\Grammar\FunctionMatcher::__construct ( $name,
Matcher $matcher )
Parameters
string | Closure | null$nameFunction name, case-insensitive, or a function to check the name.
Matcher$matcherMatcher for the contents of the function

Member Function Documentation

◆ generateMatches()

Wikimedia\CSS\Grammar\FunctionMatcher::generateMatches ( ComponentValueList $values,
$start,
array $options )
protected

@inheritDoc

Reimplemented from Wikimedia\CSS\Grammar\Matcher.

Reimplemented in Wikimedia\CSS\Grammar\UrlMatcher.


The documentation for this class was generated from the following file: