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