1 | <?php |
||
16 | class ParamDefinitionFactory { |
||
17 | |||
18 | private $types; |
||
19 | |||
20 | /** |
||
21 | * @since 1.8 |
||
22 | */ |
||
23 | 24 | public function __construct( ParameterTypes $types = null ) { |
|
26 | |||
27 | /** |
||
28 | * Returns a ParamDefinitionFactory that already has the core parameter types (@see ParameterTypes) registered. |
||
29 | * |
||
30 | * @since 1.6 |
||
31 | */ |
||
32 | 24 | public static function newDefault(): self { |
|
35 | |||
36 | /** |
||
37 | * @deprecated since 1.0 |
||
38 | */ |
||
39 | 78 | public static function singleton(): self { |
|
49 | |||
50 | /** |
||
51 | * Registers the parameter types specified in the global $wgParamDefinitions. |
||
52 | * @deprecated since 1.6 |
||
53 | */ |
||
54 | public function registerGlobals() { |
||
65 | |||
66 | /** |
||
67 | * Registers a parameter type. |
||
68 | * |
||
69 | * The type is specified as a string identifier for the type, ie 'boolean', |
||
70 | * and an array containing further data. This data currently includes: |
||
71 | * |
||
72 | * - string-parser: the parser to use to transform string values |
||
73 | * This class needs to implement ValueParser. Default: NullParser |
||
74 | * - typed-parser: DEPRECATED since 1.6 - the parser to use to transform typed PHP values |
||
75 | * This class needs to implement ValueParser. Default: NullParser |
||
76 | * - validator: the validation object to use |
||
77 | * This class needs to implement ValueValidator. Default: NullValidator |
||
78 | * - validation-callback a callback to use for validation, called before the ValueValidator |
||
79 | * This callback needs to return a boolean indicating validity. |
||
80 | * |
||
81 | * @since 1.0 |
||
82 | * |
||
83 | * @param string $type |
||
84 | * @param array $data |
||
85 | * |
||
86 | * @return boolean DEPRECATED since 1.6 - Indicates if the type was registered |
||
87 | */ |
||
88 | public function registerType( $type, array $data ) { |
||
97 | |||
98 | /** |
||
99 | * Creates a new instance of a ParamDefinition based on the provided type. |
||
100 | * |
||
101 | * @param string $typeName |
||
102 | * @param string $name |
||
103 | * @param mixed $default |
||
104 | * @param string $message |
||
105 | * @param boolean $isList |
||
106 | * |
||
107 | * @return ParamDefinition |
||
108 | * @throws OutOfBoundsException |
||
109 | */ |
||
110 | 58 | public function newDefinition( string $typeName, string $name, $default, string $message, bool $isList = false ): ParamDefinition { |
|
143 | |||
144 | /** |
||
145 | * Package private |
||
146 | */ |
||
147 | 78 | public function getType( string $typeName ): ParamType { |
|
150 | |||
151 | /** |
||
152 | * @param array $definitionArray |
||
153 | * @param bool $getMad DEPRECATED since 1.6 |
||
154 | * |
||
155 | * @return ParamDefinition|false |
||
156 | * @throws Exception |
||
157 | */ |
||
158 | 58 | public function newDefinitionFromArray( array $definitionArray, $getMad = true ) { |
|
181 | |||
182 | /** |
||
183 | * @since 1.9 |
||
184 | * |
||
185 | * @param array $definitionArrays Each element must either be |
||
186 | * - A definition array with "name" key |
||
187 | * - A name key pointing to a definition array |
||
188 | * - A ParamDefinition instance (discouraged) |
||
189 | * |
||
190 | * @return ParamDefinition[] |
||
191 | * @throws Exception |
||
192 | */ |
||
193 | 74 | public function newDefinitionsFromArrays( array $definitionArrays ): array { |
|
214 | |||
215 | } |
||
216 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.