MediaWiki master
MediaWiki\Settings\Source\Format\YamlFormat Class Reference

Inherits MediaWiki\Settings\Source\Format\SettingsFormat.

Collaboration diagram for MediaWiki\Settings\Source\Format\YamlFormat:

Public Member Functions

 __construct (array $useParsers=[self::PARSER_PHP_YAML, self::PARSER_SYMFONY])
 
 __toString ()
 
 decode (string $data)
 Decodes the given settings data and returns an associative array.
 

Static Public Member Functions

static isParserAvailable (string $parser)
 Check whether a specific YAML parser is available.
 
static supportsFileExtension (string $ext)
 Whether or not the format claims to support a file with the given extension.
 

Public Attributes

const PARSER_PHP_YAML = 'php-yaml'
 
const PARSER_SYMFONY = 'symfony'
 

Detailed Description

Definition at line 12 of file YamlFormat.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Settings\Source\Format\YamlFormat::__construct ( array  $useParsers = [ self::PARSER_PHP_YAML, self::PARSER_SYMFONY ])
Parameters
string[]$useParserswhich parsers to try in order.

Definition at line 24 of file YamlFormat.php.

Member Function Documentation

◆ __toString()

MediaWiki\Settings\Source\Format\YamlFormat::__toString ( )

Definition at line 117 of file YamlFormat.php.

◆ decode()

MediaWiki\Settings\Source\Format\YamlFormat::decode ( string  $data)

Decodes the given settings data and returns an associative array.

Parameters
string$dataSettings data.
Returns
array
Exceptions
UnexpectedValueException

Implements MediaWiki\Settings\Source\Format\SettingsFormat.

Definition at line 28 of file YamlFormat.php.

◆ isParserAvailable()

static MediaWiki\Settings\Source\Format\YamlFormat::isParserAvailable ( string  $parser)
static

Check whether a specific YAML parser is available.

Parameters
string$parserone of the PARSER_* constants.
Returns
bool

Definition at line 43 of file YamlFormat.php.

◆ supportsFileExtension()

static MediaWiki\Settings\Source\Format\YamlFormat::supportsFileExtension ( string  $ext)
static

Whether or not the format claims to support a file with the given extension.

Parameters
string$extFile extension.
Returns
bool

Implements MediaWiki\Settings\Source\Format\SettingsFormat.

Definition at line 112 of file YamlFormat.php.

Member Data Documentation

◆ PARSER_PHP_YAML

const MediaWiki\Settings\Source\Format\YamlFormat::PARSER_PHP_YAML = 'php-yaml'

Definition at line 14 of file YamlFormat.php.

◆ PARSER_SYMFONY

const MediaWiki\Settings\Source\Format\YamlFormat::PARSER_SYMFONY = 'symfony'

Definition at line 16 of file YamlFormat.php.


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