As part of T208777: Factor notification-related methods out of User and Title, introduce WatchlistNotificationManager, the replacement for User::clearNotification should only require a UserIdentity, not a full User.
The only place in the method where a full User object is required in for the hook, UserClearNewTalkNotification
Since strong typehinting was only added to hooks in the migration to interfaces in the current version, I don't believe that the object being a User is a part of the stable interface.
According to code search[1], the hook has exactly 1 use, in Echo.
I propose:
- Update Echo to expect a UserIdentity rather than a User
- Update interface documentation to type against a UserIdentity rather than a User
[1] https://codesearch.wmflabs.org/search/?q=UserClearNewTalkNotification&i=nope&files=&repos=