MediaWiki master
|
Constructs a settings array based on a PHP class by inspecting class members to construct a schema. More...
Inherits Stringable, and MediaWiki\Settings\Source\SettingsSource.
Public Member Functions | |||
__construct (string $class, bool $includeDoc=false) | |||
__toString () | |||
Returns this file source as a string. | |||
load () | |||
Loads and returns all settings from this source as an associative array.
| |||
loadAsComponents (bool $inlineReferences=false) | |||
loadAsSchema (bool $inlineReferences=false) | |||
Load the data as a single top-level JSON Schema. | |||
Constructs a settings array based on a PHP class by inspecting class members to construct a schema.
The value of each constant must be an array structured like a JSON Schema. For convenience, type declarations support PHPDoc style types in addition to JSON types. To avoid confusion, use 'list' for sequential arrays and 'map' for associative arrays.
Dynamic default values can be declared using the 'dynamicDefault' key. The structure of the dynamic default declaration is an array with two keys:
The following shorthands can be used with dynamic default declarations:
Definition at line 38 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::__construct | ( | string | $class, |
bool | $includeDoc = false ) |
string | $class | |
bool | $includeDoc |
Definition at line 56 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::__toString | ( | ) |
Returns this file source as a string.
Definition at line 162 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::load | ( | ) |
Loads and returns all settings from this source as an associative array.
SettingsBuilderException |
Implements MediaWiki\Settings\Source\SettingsSource.
Definition at line 64 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::loadAsComponents | ( | bool | $inlineReferences = false | ) |
bool | $inlineReferences | Whether the references found in the schema $ref should be inlined, meaning resolving its final type and embedding it as a regular schema. No definitions $defs will be returned. |
SettingsBuilderException |
Definition at line 75 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::loadAsSchema | ( | bool | $inlineReferences = false | ) |
Load the data as a single top-level JSON Schema.
Returned JSON Schema is for an object, which includes the individual config schemas. The returned schema may contain $defs
, which then may be referenced internally in the schema via $ref
.
bool | $inlineReferences | Whether the references found in the schema $ref should be inlined, meaning resolving its final type and embedding it as a regular schema. No definitions $defs will be returned. |
Definition at line 145 of file ReflectionSchemaSource.php.