Helper for handling SnakFormatter output formats.
More...
|
| getFallbackFormat ( $format) |
| Get the format to fallback to, in case a given format is not available.
|
|
| getFallbackChain ( $format) |
| Get the fallback chain for a given format.
|
|
| getBaseFormat ( $format) |
| Get the base output format, for a given format.
|
|
| isPossibleFormat ( $availableFormat, $targetFormat) |
| Can the given target format be served by the available format.
|
|
Helper for handling SnakFormatter output formats.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
-
Marius Hoch
◆ getBaseFormat()
Wikibase\Lib\Formatters\SnakFormat::getBaseFormat |
( |
|
$format | ) |
|
Get the base output format, for a given format.
- Parameters
-
- Returns
- string One of the SnakFormatter::FORMAT_HTML/FORMAT_WIKI/FORMAT_PLAIN constants.
◆ getFallbackChain()
Wikibase\Lib\Formatters\SnakFormat::getFallbackChain |
( |
|
$format | ) |
|
Get the fallback chain for a given format.
The returned array contains the SnakFormatter::FORMAT_* constants to use, from best fitting to worst.
- Parameters
-
string | $format | Either of the SnakFormatter::FORMAT_* constants. |
- Returns
- string[] SnakFormatter::FORMAT_* constants, starting with the most preferred format
◆ getFallbackFormat()
Wikibase\Lib\Formatters\SnakFormat::getFallbackFormat |
( |
|
$format | ) |
|
Get the format to fallback to, in case a given format is not available.
- Parameters
-
string | $format | One of the SnakFormatter::FORMAT_... constants. |
- Exceptions
-
- Returns
- string One of the SnakFormatter::FORMAT_* constants.
◆ isPossibleFormat()
Wikibase\Lib\Formatters\SnakFormat::isPossibleFormat |
( |
|
$availableFormat, |
|
|
|
$targetFormat |
|
) |
| |
Can the given target format be served by the available format.
- Parameters
-
string | $availableFormat | |
string | $targetFormat | |
- Returns
- bool Whether $availableFormat can be served by $targetFormat.
The documentation for this class was generated from the following file: