Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace MediaWiki\Extension\CommunityConfiguration\Schema;
4
5use stdClass;
6
7/**
8 * An implementation of the SchemaBuilder interface is capable of building a schema governing the
9 * configuration.
10 */
11interface SchemaBuilder {
12
13    /**
14     * Get schema name (a string that can be used to identify one schema from another)
15     *
16     * @return string
17     */
18    public function getSchemaName(): string;
19
20    /**
21     * Construct a SchemaVersionManager
22     *
23     * @return SchemaVersionManager
24     */
25    public function getVersionManager(): SchemaVersionManager;
26
27    /**
28     * Construct a SchemaReader (for the latest version)
29     *
30     * @see SchemaBuilder::getVersionManager() if you need a specific version of SchemaReader.
31     * @return SchemaReader
32     */
33    public function getSchemaReader(): SchemaReader;
34
35    /**
36     * Get the schema as a PHP associative array
37     *
38     * This method looks at the associated PHP class and builds the PHP associative
39     * array to represent it directly.
40     *
41     * @param string|null $version Schema version to use (null for newest)
42     * @return array
43     */
44    public function getRootSchema( ?string $version = null ): array;
45
46    /**
47     * Return a list of properties supported by the schema (null for newest)
48     *
49     * @param string|null $version Schema version to use
50     * @return array Map of property name => schema (that describes just that said property).
51     * Precise format of the schema is implementation-defined.
52     */
53    public function getRootProperties( ?string $version = null ): array;
54
55    /**
56     * Return default values for root-level properties
57     *
58     * @param string|null $version Schema version to use (null for newest)
59     * @return stdClass
60     */
61    public function getDefaultsMap( ?string $version = null ): stdClass;
62}