Page MenuHomePhabricator

Entire `User` class is inadvertently marked `@internal` (and `@newable`)
Closed, ResolvedPublicBUG REPORT

Description

In REL1_36, the following line was added to the class-level docstring for the User class (in user/User.php):

* @newable in 1.35 only, the constructor is @internal since 1.36

This line is present in every release since then, including the 1.39 LTS release.

Despite the "plain English" intention of describing the class' constructor, the presence of the @internal tag in the class-level docstring has the effect of marking the entire class as internal. This causes tools such as phan to issue warnings/errors for using any method from the User class.

This line also marks the class as currently @newable, though the intent is to describe the class as newable back in MW 1.35.

My suggestion, for 1.39 and future versions, is to simply remove the line in its entirety, since all this information is already correctly noted in the docstring on the __construct() method. E.g., the constructor itself is already correctly tagged as @internal.

Software version: 1.36 and later

Event Timeline

Change 946634 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/946634

Change 946634 merged by jenkins-bot:

[mediawiki/core@master] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/946634

Change 945805 had a related patch set uploaded (by Zabe; author: Umherirrender):

[mediawiki/core@REL1_40] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/945805

Change 946646 had a related patch set uploaded (by Zabe; author: Umherirrender):

[mediawiki/core@REL1_39] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/946646

Change 946646 merged by jenkins-bot:

[mediawiki/core@REL1_39] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/946646

Change 945805 merged by jenkins-bot:

[mediawiki/core@REL1_40] user: Use {@} to escape annotation when writting about annotation

https://gerrit.wikimedia.org/r/945805