Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Validators\UrlValidator Class Reference

UrlValidator checks URLs based on sub-validators for each scheme. More...

+ Inheritance diagram for Wikibase\Repo\Validators\UrlValidator:
+ Collaboration diagram for Wikibase\Repo\Validators\UrlValidator:

Public Member Functions

 __construct (array $validators)
 Constructs a UrlValidator that checks the given URL schemes. More...
 
 validate ( $url)
 
 setOptions (array $options)
 

Private Attributes

 $validators
 

Detailed Description

UrlValidator checks URLs based on sub-validators for each scheme.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\UrlValidator::__construct ( array  $validators)

Constructs a UrlValidator that checks the given URL schemes.

Parameters
ValueValidator[]$validatorsa map of scheme names (e.g. 'html') to ValueValidators. The special scheme name "*" can be used to specify a validator for other schemes. You may want to use UrlSchemaValidators to create the respective validators conveniently.
Exceptions
InvalidArgumentException

Member Function Documentation

◆ setOptions()

Wikibase\Repo\Validators\UrlValidator::setOptions ( array  $options)
See also
ValueValidator::setOptions()
Parameters
array$options

◆ validate()

Wikibase\Repo\Validators\UrlValidator::validate (   $url)
See also
ValueValidator::validate()
Parameters
string$url
Exceptions
InvalidArgumentException
Returns
Result

Member Data Documentation

◆ $validators

Wikibase\Repo\Validators\UrlValidator::$validators
private

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