diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2022-12-11 00:56:46 +0100 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2022-12-11 00:56:46 +0100 |
commit | 07697bb57cb2474d8ff21418703a1389876b1193 (patch) | |
tree | a1172104174a1964112eeb8730a9a022f29ab1f7 /includes/api/ApiQueryWatchlist.php | |
parent | 7e531cd553f5fbbf6e7edb242d9744d878f8fbac (diff) | |
download | mediawikicore-07697bb57cb2474d8ff21418703a1389876b1193.tar.gz mediawikicore-07697bb57cb2474d8ff21418703a1389876b1193.zip |
api: Replace deprecated Linker::formatComment
Bug: T324906
Change-Id: I1fcb7bd9d84754793c07ac9e39e50c38b364e4c1
Diffstat (limited to 'includes/api/ApiQueryWatchlist.php')
-rw-r--r-- | includes/api/ApiQueryWatchlist.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 0564556008b4..52edf47aeff3 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -20,7 +20,7 @@ * @file */ -use MediaWiki\Linker\Linker; +use MediaWiki\CommentFormatter\CommentFormatter; use MediaWiki\Linker\LinkTarget; use MediaWiki\ParamValidator\TypeDef\UserDef; use MediaWiki\Revision\RevisionRecord; @@ -50,6 +50,9 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { /** @var GenderCache */ private $genderCache; + /** @var CommentFormatter */ + private $commentFormatter; + /** * @param ApiQuery $query * @param string $moduleName @@ -58,6 +61,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { * @param Language $contentLanguage * @param NamespaceInfo $namespaceInfo * @param GenderCache $genderCache + * @param CommentFormatter $commentFormatter */ public function __construct( ApiQuery $query, @@ -66,7 +70,8 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { WatchedItemQueryService $watchedItemQueryService, Language $contentLanguage, NamespaceInfo $namespaceInfo, - GenderCache $genderCache + GenderCache $genderCache, + CommentFormatter $commentFormatter ) { parent::__construct( $query, $moduleName, 'wl' ); $this->commentStore = $commentStore; @@ -74,6 +79,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->contentLanguage = $contentLanguage; $this->namespaceInfo = $namespaceInfo; $this->genderCache = $genderCache; + $this->commentFormatter = $commentFormatter; } public function execute() { @@ -415,7 +421,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } if ( $this->fld_parsedcomment ) { - $vals['parsedcomment'] = Linker::formatComment( $comment, $title ); + $vals['parsedcomment'] = $this->commentFormatter->format( $comment, $title ); } } } |