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