UserIdentityUtils was recently added, and should be used instead of UserNameUtils to check for temporary/named users in some circumstances, because it has fewer dependencies.
We recently added such checks to AbuseFilter. This task is to see whether any of these calls can be made using UserIdentityUtils, and to update them if so.
When to prefer UserIdentityUtils:
- A UserIdentity is available, but not a User/Authority
- The class in question does not already depend on UserNameUtils
- It's necessary to check ::isNamed (which exists on UserIdentityUtils but not UserNameUtils)
When to prefer UserNameUtils:
- Only the username is available
- UserNameUtils is already a dependency of the class
Note that UserNameUtils::isTemp takes a string, whereas UserIdentityUtils::isTemp takes a UserIdentity.
Please see the relevant methods on both classes for more details.