Many block-related methods are using User typehints rather than UserIdentity for the performer. Specifically:
- UserBlockCommandFactory and the interfaces it implements
- Uses Authority since r672572
- BlockUser and UnblockUser
- Uses Authority since r672572
- BlockPermissionCheckerFactory and BlockPermissionChecker
I've checked whether it's possible to change this. For the most part, it is, and I could only find two issues:
- Usage of User::getBlock() & friends (blocked on T221067)
- User objects being passed to hooks: onBlockIp, onBlockIpComplete, onUnblockUser, onUnblockUserComplete
The first point will be easily resolved once those methods are migrated to BlockManager. As for the hooks, we cannot just change the types. The two BlockUser hooks actually have a simpler solution: deprecate them and replace with a hook mentioning "User", not "Ip", so we'd have onBlockUser and onBlockUserComplete. However, the ones in UnblockUser already have the correct name. We can either find another name (but then hooks in BlockUser should use the same convention), or add some BC hacks, for instance some StubObject-like class that could emit a deprecation warning.