1 | <?php |
||
18 | class ValueParser { |
||
19 | |||
20 | /** |
||
21 | * @var MediawikiApi |
||
22 | */ |
||
23 | private $api; |
||
24 | |||
25 | /** |
||
26 | * @var Deserializer |
||
27 | */ |
||
28 | private $dataValueDeserializer; |
||
29 | |||
30 | /** |
||
31 | * @param MediawikiApi $api |
||
32 | * @param Deserializer $dataValueDeserializer |
||
33 | */ |
||
34 | public function __construct( MediawikiApi $api, Deserializer $dataValueDeserializer ) { |
||
38 | |||
39 | /** |
||
40 | * @since 0.2 |
||
41 | * |
||
42 | * @param string|string[] $inputValues one or more |
||
43 | * @param string $parser Id of the ValueParser to use |
||
44 | * |
||
45 | * @returns DataValue|DataValue[] if array parsed object has same array key as value |
||
46 | */ |
||
47 | public function parse( $inputValues, $parser ) { |
||
50 | |||
51 | /** |
||
52 | * @since 0.7 |
||
53 | * |
||
54 | * @param string|string[] $inputValues one or more |
||
55 | * @param string $parser Id of the ValueParser to use |
||
56 | * |
||
57 | * @returns Promise of a DataValue object or array of DataValue objects with same keys as values |
||
58 | */ |
||
59 | public function parseAsync( $inputValues, $parser ) { |
||
90 | |||
91 | } |
||
92 |