Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Validators\UrlSchemeValidators Class Reference

UrlSchemeValidators is a collection of validators for some commonly used URL schemes. More...

Public Member Functions

 getValidator ( $scheme)
 Returns a validator for the given URL scheme, or null if no validator is defined for that scheme.
 
 getValidators (array $schemes)
 Given a list of schemes, this function returns a mapping for each supported scheme to a corresponding ValueValidator.
 

Detailed Description

UrlSchemeValidators is a collection of validators for some commonly used URL schemes.

This is intended for conveniently supplying a map of validators to UrlValidator.

Author
Daniel Kinzler
Thiemo Kreuz

Member Function Documentation

◆ getValidator()

Wikibase\Repo\Validators\UrlSchemeValidators::getValidator (   $scheme)

Returns a validator for the given URL scheme, or null if no validator is defined for that scheme.

Todo:

'bitcoin', 'geo', 'magnet', 'news', 'sip', 'sips', 'sms', 'tel', 'urn', 'xmpp'.

protocol relative '//'.

Parameters
string$schemee.g. 'http'.
Returns
ValueValidator|null

◆ getValidators()

Wikibase\Repo\Validators\UrlSchemeValidators::getValidators ( array  $schemes)

Given a list of schemes, this function returns a mapping for each supported scheme to a corresponding ValueValidator.

If the schema isn't supported, no mapping is created for it.

Parameters
string[]$schemesa list of scheme names, e.g. 'http'.
Returns
ValueValidator[] a map of scheme names to ValueValidator objects.

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