diff --git a/includes/CommentFormatter.php b/includes/CommentFormatter.php index 891cf443c..69f18d80b 100644 --- a/includes/CommentFormatter.php +++ b/includes/CommentFormatter.php @@ -12,7 +12,6 @@ use MediaWiki\MediaWikiServices; use MediaWiki\User\UserIdentity; use MWExceptionHandler; use MWTimestamp; -use Parser; use ParserOutput; use Sanitizer; use Throwable; @@ -49,10 +48,9 @@ class CommentFormatter { * * @param string &$text Parser text output (modified by reference) * @param ParserOutput $pout ParserOutput object for metadata, e.g. parser limit report - * @param Parser $parser + * @param Title $title */ - public static function addDiscussionTools( string &$text, ParserOutput $pout, Parser $parser ): void { - $title = $parser->getTitle(); + public static function addDiscussionTools( string &$text, ParserOutput $pout, Title $title ): void { $start = microtime( true ); $requestId = null; diff --git a/includes/Hooks/ParserHooks.php b/includes/Hooks/ParserHooks.php index 10628b447..6bcbffcc4 100644 --- a/includes/Hooks/ParserHooks.php +++ b/includes/Hooks/ParserHooks.php @@ -65,7 +65,7 @@ class ParserHooks implements // the user doesn't have DiscussionTools features enabled. if ( HookUtils::isAvailableForTitle( $title ) ) { // This modifies $text - CommentFormatter::addDiscussionTools( $text, $pout, $parser ); + CommentFormatter::addDiscussionTools( $text, $pout, $title ); if ( $parser->getOptions()->getIsPreview() ) { $text = CommentFormatter::removeInteractiveTools( $text );