1 | <?php |
||
23 | class DataTypesModule extends ResourceLoaderModule { |
||
24 | |||
25 | /** |
||
26 | * @var DataType[] |
||
27 | */ |
||
28 | protected $dataTypes; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $dataTypesConfigVarName; |
||
34 | |||
35 | /** |
||
36 | * @var DataTypeFactory |
||
37 | */ |
||
38 | protected $dataTypeFactory; |
||
39 | |||
40 | /** |
||
41 | * @since 0.1 |
||
42 | * |
||
43 | * @param array $resourceDefinition |
||
44 | */ |
||
45 | public function __construct( array $resourceDefinition ) { |
||
55 | |||
56 | /** |
||
57 | * @since 0.1 |
||
58 | * |
||
59 | * @param array $resourceDefinition |
||
60 | * |
||
61 | * @return string |
||
62 | * @throws Exception If the given resource definition is not sufficient |
||
63 | */ |
||
64 | public static function extractDataTypesConfigVarNameFromResourceDefinition( |
||
81 | |||
82 | /** |
||
83 | * @since 0.1 |
||
84 | * |
||
85 | * @param array $resourceDefinition |
||
86 | * |
||
87 | * @return DataTypeFactory |
||
88 | * @throws Exception If the given resource definition is not sufficient |
||
89 | */ |
||
90 | public static function extractDataTypeFactoryFromResourceDefinition( |
||
110 | |||
111 | /** |
||
112 | * Returns the name of the config var key under which the data type definition will be available |
||
113 | * in JavaScript using "mw.config.get( '...' )" |
||
114 | * |
||
115 | * @since 0.1 |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getConfigVarName() { |
||
122 | |||
123 | /** |
||
124 | * Returns the data types factory providing the data type information. |
||
125 | * |
||
126 | * @since 0.1 |
||
127 | * |
||
128 | * @return DataTypeFactory |
||
129 | */ |
||
130 | public function getDataTypeFactory() { |
||
133 | |||
134 | /** |
||
135 | * Used to propagate available data type ids to JavaScript. |
||
136 | * Data type ids will be available in 'wbDataTypeIds' config var. |
||
137 | * @see ResourceLoaderModule::getScript |
||
138 | * |
||
139 | * @since 0.1 |
||
140 | * |
||
141 | * @param ResourceLoaderContext $context |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getScript( ResourceLoaderContext $context ) { |
||
156 | |||
157 | /** |
||
158 | * Returns the message keys of the registered data types. |
||
159 | * @see ResourceLoaderModule::getMessages |
||
160 | * @since 0.1 |
||
161 | * |
||
162 | * @return Array |
||
163 | */ |
||
164 | public function getMessages() { |
||
176 | |||
177 | /** |
||
178 | * @see ResourceLoaderModule::getDefinitionSummary |
||
179 | * |
||
180 | * @param ResourceLoaderContext $context |
||
181 | * |
||
182 | * @return array |
||
183 | */ |
||
184 | public function getDefinitionSummary( ResourceLoaderContext $context ) { |
||
192 | |||
193 | } |
||
194 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..