Document shortcoming of CommentFormatter::isEmptyTalkPage

Follows-Up: I5c1877f7f9eb73f88a33e001ca3c2f3d06bb90e4
Change-Id: Idb74807c105062f81954917fe4e8296be2b428f6
This commit is contained in:
Arlo Breault 2024-08-16 12:03:21 -04:00
parent 51b17a6191
commit 8245b94c4c

View file

@ -917,6 +917,13 @@ class CommentFormatter {
/** /**
* Check if the talk page had no comments or headings. * Check if the talk page had no comments or headings.
*
* Note that the implementation here is using a double negative which
* doesn't guarantee a *talk page*, only that the page is not not an empty
* talk page, which could be many other types of page.
*
* The current use of this method is paired with
* HookUtils::shouldDisplayEmptyState which assures we have a talk page.
*/ */
public static function isEmptyTalkPage( ParserOutput $pout ): bool { public static function isEmptyTalkPage( ParserOutput $pout ): bool {
return $pout->getExtensionData( 'DiscussionTools-isNotEmptyTalkPage' ) !== true; return $pout->getExtensionData( 'DiscussionTools-isNotEmptyTalkPage' ) !== true;