ParsoidClient: Improve return type documentation for Phan

Change-Id: I1aecdc5ab7a21e1ef43ddcec4f4dbea610822493
This commit is contained in:
Bartosz Dziewoński 2022-10-21 00:46:45 +02:00
parent 9c25161966
commit ac946cff36

View file

@ -14,6 +14,7 @@ interface ParsoidClient {
* @param Language|null $targetLanguage Desired output language * @param Language|null $targetLanguage Desired output language
* *
* @return array An array containing the keys 'body', 'headers', and optionally 'error' * @return array An array containing the keys 'body', 'headers', and optionally 'error'
* @phan-return array{body:string,headers:array<string,string>,error?:non-empty-array}
*/ */
public function getPageHtml( RevisionRecord $revision, ?Language $targetLanguage ): array; public function getPageHtml( RevisionRecord $revision, ?Language $targetLanguage ): array;
@ -27,6 +28,7 @@ interface ParsoidClient {
* @param ?string $etag The ETag to set in the HTTP request header * @param ?string $etag The ETag to set in the HTTP request header
* *
* @return array An array containing the keys 'body', 'headers', and optionally 'error' * @return array An array containing the keys 'body', 'headers', and optionally 'error'
* @phan-return array{body:string,headers:array<string,string>,error?:non-empty-array}
*/ */
public function transformHTML( public function transformHTML(
PageIdentity $page, PageIdentity $page,
@ -47,6 +49,7 @@ interface ParsoidClient {
* @param bool $stash Whether to stash the result in the server-side cache (default: `false`) * @param bool $stash Whether to stash the result in the server-side cache (default: `false`)
* *
* @return array An array containing the keys 'body', 'headers', and optionally 'error' * @return array An array containing the keys 'body', 'headers', and optionally 'error'
* @phan-return array{body:string,headers:array<string,string>,error?:non-empty-array}
*/ */
public function transformWikitext( public function transformWikitext(
PageIdentity $page, PageIdentity $page,