Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Documentation standards recommend using interfaces instead of classes whenever possible, and a lot of $account and $user ($admin_user, $web_user, etc for tests) remain undocumented through the code.
Proposed resolution
Search for all undocumented user-like variables and document them properly.
Comment from jhodgdon:
As a bonus, a grep through core for references to Drupal\user\Plugin\Core\Entity\User in documentation would help us figure out the scope.
Comments
Comment #1
BerdirNote that there's also AccountInterface, which should be used if the argument is either a global user or a user entity, they're not the same class.
Comment #2
BerdirAlso, no need to hurry with this one. We're in full conversion mode of converting user/account properties to those interfaces and clean up documentation and code as we touch related functions anyway.
Comment #14
quietone CreditAttribution: quietone at PreviousNext commentedYes, undocumented code is not idea. Since this issue was opened core started using phpcs to improve documentation. There are sniffs to detect undocumented parameters and while they are not all being used yet, there are issues for them. The intended work has moved to those issues, #2571965: [meta] Fix PHP coding standards in core