diff --git a/includes/CommentModifier.php b/includes/CommentModifier.php index f88f78dfa..d10cec98d 100644 --- a/includes/CommentModifier.php +++ b/includes/CommentModifier.php @@ -87,7 +87,7 @@ class CommentModifier { * Given a comment and a reply link, add the reply link to its document's DOM tree, at the end of * the comment. * - * @param CommentItem $comment Comment data returned by parser#groupThreads + * @param CommentItem $comment Comment item * @param DOMElement $linkNode Reply link */ public static function addReplyLink( CommentItem $comment, DOMElement $linkNode ) : void { @@ -123,7 +123,7 @@ class CommentModifier { * The DOM tree is suitably rearranged to ensure correct indentation level of the reply (wrapper * nodes are added, and other nodes may be moved around). * - * @param CommentItem $comment Comment data returned by parser#groupThreads + * @param CommentItem $comment Comment item * @return DOMElement */ public static function addListItem( CommentItem $comment ) : DOMElement { diff --git a/includes/CommentParser.php b/includes/CommentParser.php index 78c037773..e5d5a76b7 100644 --- a/includes/CommentParser.php +++ b/includes/CommentParser.php @@ -939,7 +939,7 @@ class CommentParser { /** * Get the list of authors involved in a comment and its replies. * - * @param HeadingItem $heading Heading object, as returned by #groupThreads + * @param HeadingItem $heading Heading item * @return string[] Author usernames */ public function getAuthors( HeadingItem $heading ) : array { @@ -962,7 +962,7 @@ class CommentParser { /** * Get the name of the page from which this comment is transcluded (if any). * - * @param CommentItem $comment Comment object, as returned by #groupThreads + * @param CommentItem $comment Comment item * @return string|bool `false` if this comment is not transcluded. A string if it's transcluded * from a single page (the page title, in text form with spaces). `true` if it's transcluded, but * we can't determine the source. diff --git a/includes/CommentUtils.php b/includes/CommentUtils.php index 2a0b2d11d..daa83e15d 100644 --- a/includes/CommentUtils.php +++ b/includes/CommentUtils.php @@ -117,7 +117,7 @@ class CommentUtils { /** * Get a node (if any) that contains the given comment, and nothing else. * - * @param CommentItem $comment Comment data returned by parser#groupThreads + * @param CommentItem $comment Comment item * @return DOMElement|null */ public static function getFullyCoveredWrapper( CommentItem $comment ) : ?DOMElement { diff --git a/modules/modifier.js b/modules/modifier.js index 64aabb6a1..fa2f2a572 100644 --- a/modules/modifier.js +++ b/modules/modifier.js @@ -59,7 +59,7 @@ function sanitizeWikitextLinebreaks( wikitext ) { * Given a comment and a reply link, add the reply link to its document's DOM tree, at the end of * the comment. * - * @param {CommentItem} comment Comment data returned by parser#groupThreads + * @param {CommentItem} comment Comment item * @param {HTMLElement} linkNode Reply link */ function addReplyLink( comment, linkNode ) { @@ -90,7 +90,7 @@ function addReplyLink( comment, linkNode ) { * The DOM tree is suitably rearranged to ensure correct indentation level of the reply (wrapper * nodes are added, and other nodes may be moved around). * - * @param {CommentItem} comment Comment data returned by parser#groupThreads + * @param {CommentItem} comment Comment item * @return {HTMLElement} */ function addListItem( comment ) { diff --git a/modules/parser.js b/modules/parser.js index fb3de07b8..a1b89f352 100644 --- a/modules/parser.js +++ b/modules/parser.js @@ -915,7 +915,7 @@ function groupThreads( comments ) { /** * Get the list of authors involved in a comment and its replies. * - * @param {HeadingItem} heading Comment object, as returned by #groupThreads + * @param {HeadingItem} heading Heading item * @return {string[]} Author usernames */ function getAuthors( heading ) { @@ -934,7 +934,7 @@ function getAuthors( heading ) { /** * Get the name of the page from which this comment is transcluded (if any). * - * @param {CommentItem} comment Comment object, as returned by #groupThreads + * @param {CommentItem} comment Comment item * @return {string|boolean} `false` if this comment is not transcluded. A string if it's transcluded * from a single page (the page title, in text form with spaces). `true` if it's transcluded, but * we can't determine the source. diff --git a/modules/utils.js b/modules/utils.js index 82fc03dcf..28ae3b758 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -1,6 +1,10 @@ 'use strict'; /* global $:off */ +/** + * @external CommentItem + */ + /** * Return a native Range object corresponding to our comment's range. * @@ -117,7 +121,7 @@ function htmlTrim( str ) { /** * Get a node (if any) that contains the given comment, and nothing else. * - * @param {Object} comment Comment data returned by parser#groupThreads + * @param {CommentItem} comment Comment item * @return {HTMLElement|null} */ function getFullyCoveredWrapper( comment ) { diff --git a/tests/phpunit/CommentParserTest.php b/tests/phpunit/CommentParserTest.php index c3fc13c30..2502d465a 100644 --- a/tests/phpunit/CommentParserTest.php +++ b/tests/phpunit/CommentParserTest.php @@ -270,8 +270,7 @@ class CommentParserTest extends CommentTestCase { /** * @dataProvider provideTranscludedFrom - * @covers ::getComments - * @covers ::groupThreads + * @covers ::getTranscludedFrom * @covers \MediaWiki\Extension\DiscussionTools\CommentUtils::unwrapParsoidSections */ public function testGetTranscludedFrom( diff --git a/tests/qunit/testUtils.js b/tests/qunit/testUtils.js index ea1147418..e7ad2e579 100644 --- a/tests/qunit/testUtils.js +++ b/tests/qunit/testUtils.js @@ -1,3 +1,7 @@ +/** + * @external CommentItem + */ + var utils = require( 'ext.discussionTools.init' ).utils; @@ -76,7 +80,7 @@ function getOffsetPath( ancestor, node, nodeOffset ) { /** * Massage comment data to make it serializable as JSON. * - * @param {Object} parent Comment returned by parser#groupThreads; modified in-place + * @param {CommentItem} parent Comment item; modified in-place * @param {Node} root Ancestor node of all comments */ module.exports.serializeComments = function ( parent, root ) {