MediaWiki master
|
Constructs a settings array based on a PHP class by inspecting class members to construct a schema. More...
Inherits 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 () | |||
loadAsSchema () | |||
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 37 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::__construct | ( | string | $class, |
bool | $includeDoc = false ) |
string | $class | |
bool | $includeDoc |
Definition at line 55 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::__toString | ( | ) |
Returns this file source as a string.
Definition at line 157 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 63 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::loadAsComponents | ( | ) |
SettingsBuilderException |
Definition at line 71 of file ReflectionSchemaSource.php.
MediaWiki\Settings\Source\ReflectionSchemaSource::loadAsSchema | ( | ) |
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
.
Definition at line 138 of file ReflectionSchemaSource.php.