diff -u b/core/lib/Drupal/Core/Session/AccountInterface.php b/core/lib/Drupal/Core/Session/AccountInterface.php --- b/core/lib/Drupal/Core/Session/AccountInterface.php +++ b/core/lib/Drupal/Core/Session/AccountInterface.php @@ -106,22 +106,30 @@ public function getPreferredAdminLangcode($fallback_to_default = TRUE); /** - * Returns the username of this account. + * Returns the unaltered login name of this account. * * @return - * An unsanitized plain-text string with the username to display. + * An unsanitized plain-text string with the name of this account that is + * used to log in. Only display this name to admins and to the user who owns + * this account, and only in the context of the name used to login. For + * any other display purposes, use + * \Drupal\Core\Session\AccountInterface::getDisplayName() instead. * * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. - * Use Drupal\Core\Session\AccountInterface::getAccountName() or + * Use \Drupal\Core\Session\AccountInterface::getAccountName() or * \Drupal\user\RoleInterface::getDisplayName() instead. */ public function getUsername(); /** - * Returns the unaltered name of this account. + * Returns the unaltered login name of this account. * * @return - * An unsanitized plain-text string with the username to display. + * An unsanitized plain-text string with the name of this account that is + * used to log in. Only display this name to admins and to the user who owns + * this account, and only in the context of the name used to login. For + * any other display purposes, use + * \Drupal\Core\Session\AccountInterface::getDisplayName() instead. */ public function getAccountName();