X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiParse.php;h=7ec0e2ea2543a85dcdbce8914324b1cbf77c6d05;hb=e65f8ac5110804067366f9f239c13f4f29b66c3d;hp=a7390e617a05fb95e55bd0603df76cdeeacaec8b;hpb=0ae01716c36bd03192a6dc79816beee8a0a74fa5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index a7390e617a..7ec0e2ea25 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -21,7 +21,7 @@ */ use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Revision\RevisionRecord; /** * @ingroup API @@ -491,6 +491,7 @@ class ApiParse extends ApiBase { $parser = MediaWikiServices::getInstance()->getParser(); $parser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS ); + // @phan-suppress-next-line PhanUndeclaredMethod $xml = $parser->preprocessToDom( $this->content->getText() )->__toString(); $result_array['parsetree'] = $xml; $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree'; @@ -598,7 +599,9 @@ class ApiParse extends ApiBase { $pout = $page->getParserOutput( $popts, $revId, $suppressCache ); } if ( !$pout ) { - $this->dieWithError( [ 'apierror-nosuchrevid', $revId ?: $page->getLatest() ] ); // @codeCoverageIgnore + // @codeCoverageIgnoreStart + $this->dieWithError( [ 'apierror-nosuchrevid', $revId ?: $page->getLatest() ] ); + // @codeCoverageIgnoreEnd } return $pout;