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 | namespace ContentTranslation; |
3 | |
4 | use MediaWiki\Page\PageIdentity; |
5 | |
6 | interface ParsoidClient { |
7 | |
8 | /** |
9 | * Transform HTML to wikitext via Parsoid |
10 | * |
11 | * @param PageIdentity $page The page the content belongs to |
12 | * @param string $html The HTML of the page to be transformed |
13 | * |
14 | * @return array An array containing the keys 'body', 'headers', and optionally 'error' |
15 | */ |
16 | public function convertHtmlToWikitext( |
17 | PageIdentity $page, |
18 | string $html |
19 | ): array; |
20 | |
21 | /** |
22 | * Transform wikitext to HTML via Parsoid. |
23 | * |
24 | * @param PageIdentity $page The page the content belongs to |
25 | * @param string $wikitext The wikitext fragment to parse |
26 | * |
27 | * @return array An array containing the keys 'body', 'headers', and optionally 'error' |
28 | */ |
29 | public function convertWikitextToHtml( |
30 | PageIdentity $page, |
31 | string $wikitext |
32 | ): array; |
33 | } |