Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\PropertyInfoSnakUrlExpander Class Reference

SnakUrlExpander that uses an PropertyInfoProvider to find a URL pattern for expanding a Snak's value into an URL. More...

+ Inheritance diagram for Wikibase\Lib\PropertyInfoSnakUrlExpander:
+ Collaboration diagram for Wikibase\Lib\PropertyInfoSnakUrlExpander:

Public Member Functions

 __construct (PropertyInfoProvider $infoProvider)
 
 expandUrl (PropertyValueSnak $snak)
 

Private Attributes

const ALLOWED_PROTOCOLS
 URL protocols (schemes) that are allowed in the pattern. More...
 
 $infoProvider
 

Detailed Description

SnakUrlExpander that uses an PropertyInfoProvider to find a URL pattern for expanding a Snak's value into an URL.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\PropertyInfoSnakUrlExpander::__construct ( PropertyInfoProvider  $infoProvider)

Member Function Documentation

◆ expandUrl()

Wikibase\Lib\PropertyInfoSnakUrlExpander::expandUrl ( PropertyValueSnak  $snak)
See also
SnakUrlExpander::expandUrl
Parameters
PropertyValueSnak$snak
Returns
string|null A URL or URI derived from the Snak, or null if no such URL could be determined.

Implements Wikibase\Lib\SnakUrlExpander.

Member Data Documentation

◆ $infoProvider

Wikibase\Lib\PropertyInfoSnakUrlExpander::$infoProvider
private

◆ ALLOWED_PROTOCOLS

const Wikibase\Lib\PropertyInfoSnakUrlExpander::ALLOWED_PROTOCOLS
private
Initial value:
= [
'https' => null,
'http' => null,
'tel' => null,
]

URL protocols (schemes) that are allowed in the pattern.


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