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

Matcher that matches a CSSFunction for a URL or a T_URL token. More...

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

Public Member Functions

 __construct (callable $urlCheck=null, array $options=[])
 
- Public Member Functions inherited from Wikimedia\CSS\Grammar\FunctionMatcher
 __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.
 

Static Public Member Functions

static anyModifierMatcher ()
 Return a Matcher for any grammatically-correct modifier.
 
- Static Public Member Functions inherited from Wikimedia\CSS\Grammar\Matcher
static create (... $args)
 Create an instance.
 

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

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

Detailed Description

Matcher that matches a CSSFunction for a URL or a T_URL token.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\CSS\Grammar\UrlMatcher::__construct ( callable $urlCheck = null,
array $options = [] )
Parameters
callable | null$urlCheckFunction to check that the URL is really valid. Prototype is bool func( string $url, ComponentValue[] $modifiers )
array$optionsAdditional options:
  • modifierMatcher: (Matcher) Matcher for URL modifiers. The default is a NothingMatcher.

Member Function Documentation

◆ anyModifierMatcher()

static Wikimedia\CSS\Grammar\UrlMatcher::anyModifierMatcher ( )
static

Return a Matcher for any grammatically-correct modifier.

Returns
Matcher

◆ generateMatches()

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

@inheritDoc

Reimplemented from Wikimedia\CSS\Grammar\FunctionMatcher.


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